51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
listen [::]:80;
|
||
|
|
|
||
|
|
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;
|
||
|
|
|
||
|
|
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 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";
|
||
|
|
add_header X-Content-Type-Options nosniff;
|
||
|
|
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|