Update NGINX example

This commit is contained in:
Alexandre Iooss 2022-01-30 20:13:05 +01:00
parent a719203ee0
commit 167c9cb45b

View file

@ -37,13 +37,17 @@ server {
# Allow 2Go upload at once # Allow 2Go upload at once
client_max_body_size 2G; client_max_body_size 2G;
add_header "X-XSS-Protection" "1; mode=block";
add_header "Content-Security-Policy" "default-src 'self' 'unsafe-inline';";
# Django statics and media # Django statics and media
# Do not directly serve media, it must be authorized # Do not directly serve media, it must be authorized
# by a Django view to check permissions # by a Django view to check permissions
location /protected/media { location /protected/media {
internal; internal;
alias /var/www/photos/photo21/media; alias /var/www/photos/photo21/media;
} }
location /static { location /static {
alias /var/www/photos/photo21/static; alias /var/www/photos/photo21/static;
} }
@ -51,5 +55,9 @@ server {
location / { location / {
uwsgi_pass unix:///var/run/uwsgi/app/uwsgi_photos/socket; uwsgi_pass unix:///var/run/uwsgi/app/uwsgi_photos/socket;
include /etc/nginx/uwsgi_params; include /etc/nginx/uwsgi_params;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
} }
} }