bookstack-ppm/app/default.conf

57 lines
2.4 KiB
Plaintext
Raw Normal View History

2018-06-10 14:13:09 +00:00
server {
2019-08-01 13:43:47 +00:00
listen 8888;
listen [::]:8888;
2018-06-10 14:13:09 +00:00
server_name _;
root /app/public/;
client_max_body_size 1000m;
client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads
client_body_buffer_size 128k;
2019-07-31 12:47:45 +00:00
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'; frame-ancestors 'none'; report-uri https://<YOUR_ACCOUNT>.report-uri.com/r/d/csp/enforce; report-to default;" always;
2018-06-10 14:13:09 +00:00
add_header Expect-CT "enforce; max-age=604800; report-uri=https://<YOUR_ACCOUNT>.report-uri.com/r/d/ct/enforce";
2019-05-08 12:04:15 +00:00
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'";
2018-06-10 14:13:09 +00:00
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
add_header Referrer-Policy "strict-origin";
2019-07-31 12:47:45 +00:00
add_header Report-To "{'group':'default','max_age':31536000,'endpoints':[{'url':'https://<YOUR_ACCOUNT>.report-uri.com/a/d/g'}],'include_subdomains':true}";
add_header NEL "{'report_to':'default','max_age':31536000,'include_subdomains':true}";
2018-06-10 14:13:09 +00:00
add_header X-Content-Type-Options nosniff;
2019-05-08 12:04:15 +00:00
# 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'";
}
2018-06-10 14:13:09 +00:00
location / {
try_files $uri @ppm;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|js|html|xml|txt)$ {
access_log off;
log_not_found off;
expires 360d;
}
# PHP-PM is doing its thing
location @ppm {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080;
}
# 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;
}
}