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'; frame-ancestors 'none'; report-uri https://.report-uri.com/r/d/csp/enforce; report-to default;" always; add_header Expect-CT "enforce; max-age=604800; report-uri=https://.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 Report-To "{'group':'default','max_age':31536000,'endpoints':[{'url':'https://.report-uri.com/a/d/g'}],'include_subdomains':true}"; add_header NEL "{'report_to':'default','max_age':31536000,'include_subdomains':true}"; 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 / { 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; } }