zola/site-example/app/default.conf

45 lines
1.9 KiB
Plaintext

server {
listen 80;
listen [::]:80;
server_name _;
root /app/public/;
client_max_body_size 0m;
client_body_timeout 60s; # Default is 60, May need to be increased for very large uploads
client_body_buffer_size 128k;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self'; connect-src 'self'; font-src 'self'; form-action 'self'; report-uri https://<YOUR_ACCOUNT>.report-uri.com/r/d/csp/enforce;" always;
add_header Expect-CT "enforce; max-age=604800; report-uri=https://<YOUR_ACCOUNT>.report-uri.com/r/d/ct/enforce";
add_header Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; encrypted-media 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; sync-xhr 'none'; usb 'none'; vr 'none'";
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
add_header Referrer-Policy "strict-origin";
add_header X-Xss-Protection "1; mode=block; report=https://<YOUR_ACCOUNT>.report-uri.com/r/d/xss/enforce" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options nosniff;
# Firefox CSP bug workaround - https://bugzilla.mozilla.org/show_bug.cgi?id=1262842
location ~ \.svg$ {
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'; style-src 'self' 'unsafe-inline'";
}
location ~* \.(jpg|jpeg|gif|png|ico|css|js|html|xml|txt)$ {
access_log off;
log_not_found off;
expires 360d;
}
# Block access to PHP files
location ~* \.(php|php3|php4|php5|php7|phtml|inc)$ {
deny all;
}
# Block access to stuff begining with .
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
}