From 7bb918b2e365f124fff6021c75e0505864c156c3 Mon Sep 17 00:00:00 2001 From: Morgan <10958823+morganhvidt@users.noreply.github.com> Date: Mon, 16 Dec 2019 10:44:32 +0800 Subject: [PATCH] Protect Easy Digital Download files from being accessed directly. Easy Digital Download files won't be able to be downloaded directly from the server. https://docs.easydigitaldownloads.com/article/682-protected-download-files-on-nginx --- wo/cli/templates/wpcommon.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wo/cli/templates/wpcommon.mustache b/wo/cli/templates/wpcommon.mustache index 8b1b9fe..2955a95 100644 --- a/wo/cli/templates/wpcommon.mustache +++ b/wo/cli/templates/wpcommon.mustache @@ -94,3 +94,7 @@ location ~* /(?:uploads|files)/.*\.php$ { location ~ \/wp-admin\/load-(scripts|styles).php { deny all; } +# Protect Easy Digital Download files from being accessed directly. +location ~ ^/wp-content/uploads/edd/(.*?)\.zip$ { + rewrite / permanent; +}