Use NGINX X-Accel-Redirect to protect media
This commit is contained in:
parent
29e9dba141
commit
eb03db2dff
3 changed files with 22 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue