forked from colin/resume
Update docker/resume/nginx.conf
This commit is contained in:
parent
0d96f47c2e
commit
6a6b69ae3e
|
@ -1,5 +1,11 @@
|
|||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
# Rate limiting zone defined at the top-level 'http' block
|
||||
limit_req_zone $binary_remote_addr zone=default:10m rate=20r/s;
|
||||
|
||||
server {
|
||||
|
@ -14,38 +20,24 @@ http {
|
|||
|
||||
server_name colinknapp.com www.colinknapp.com;
|
||||
|
||||
# Security headers
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=(), payment=()" always;
|
||||
|
||||
# Content Security Policy (CSP)
|
||||
add_header Content-Security-Policy "
|
||||
default-src 'self';
|
||||
script-src 'self' https://matomo.nixc.us/js/tracker.js https://colinknapp.com/scripts/some-script.js;
|
||||
style-src 'self' 'unsafe-inline' https://colinknapp.com/styles/main.css;
|
||||
img-src 'self' https://colinknapp.com/icons data:;
|
||||
connect-src 'self' https://matomo.nixc.us;
|
||||
font-src 'self' fonts.gstatic.com;
|
||||
base-uri 'self';
|
||||
form-action 'self';
|
||||
" always;
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://matomo.nixc.us/js/tracker.js https://colinknapp.com/scripts/some-script.js; style-src 'self' 'unsafe-inline' https://colinknapp.com/styles/main.css; img-src 'self' https://colinknapp.com/icons data:; connect-src 'self' https://matomo.nixc.us; font-src 'self' fonts.gstatic.com; base-uri 'self'; form-action 'self';" always;
|
||||
|
||||
# Enable long-term caching for JavaScript, CSS, and HTML files
|
||||
location ~* \.(js|css|html)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
# Apply rate limiting within the server block
|
||||
location / {
|
||||
limit_req zone=default burst=30;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# HTTP/3 advertisement header
|
||||
add_header Alt-Svc 'h3-29=":8080"; ma=86400';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue