Skip to content
Snippets Groups Projects

Use NGINX X-Accel-Redirect to protect media

Merged me5na7qbjqbrp requested to merge force_auth into master
3 files
+ 22
4
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 7
1
@@ -34,8 +34,14 @@ server {
error_log /var/log/nginx/photos.crans.org_error.log;
access_log /var/log/nginx/photos.crans.org_access.log;
# Allow 2Go upload at once
client_max_body_size 2G;
# Django statics and media
location /media {
# Do not directly serve media, it must be authorized
# by a Django view to check permissions
location /protected/media {
internal;
alias /var/www/photos/photo21/media;
}
location /static {
Loading