From cc2ee96881ee186fc433b7733efbce720888d6a0 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Thu, 25 May 2017 00:22:28 +0200 Subject: [PATCH] Differentiate media access protection through Nginx --- etc/nginx.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/etc/nginx.conf b/etc/nginx.conf index 4c1df0cb..c09e32f4 100644 --- a/etc/nginx.conf +++ b/etc/nginx.conf @@ -12,6 +12,22 @@ server { client_max_body_size 4096M; # adjust to taste # Django media + location /media { + alias /srv/media; # your Django project's media files - amend as required + # Django media export + location /media/export { + internal; # protect media files directory only accessible through Django + alias /srv/media/export; + } + # Django media items + location /media/items { + internal; # protect media files directory only accessible through Django + alias /srv/media/items; + } + + } + +# Django media location /media { internal; # protect media files directory only accessible through Django alias /srv/media; # your Django project's media files - amend as required -- 2.39.5