2026-03-25 20:38:29 +01:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
listen [::]:80;
|
|
|
|
|
server_name staging.letsbe.biz;
|
|
|
|
|
|
|
|
|
|
# Certbot will add SSL config after: sudo certbot --nginx -d staging.letsbe.biz
|
|
|
|
|
|
|
|
|
|
location / {
|
2026-03-25 21:17:49 +01:00
|
|
|
proxy_pass http://127.0.0.1:3847;
|
2026-03-25 20:38:29 +01:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection 'upgrade';
|
|
|
|
|
proxy_set_header Host $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_cache_bypass $http_upgrade;
|
|
|
|
|
proxy_read_timeout 86400;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Static assets — long cache
|
|
|
|
|
location /_next/static/ {
|
2026-03-25 21:17:49 +01:00
|
|
|
proxy_pass http://127.0.0.1:3847;
|
2026-03-25 20:38:29 +01:00
|
|
|
proxy_cache_valid 200 365d;
|
|
|
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Public assets
|
|
|
|
|
location /images/ {
|
2026-03-25 21:17:49 +01:00
|
|
|
proxy_pass http://127.0.0.1:3847;
|
2026-03-25 20:38:29 +01:00
|
|
|
proxy_cache_valid 200 30d;
|
|
|
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Payload media uploads
|
|
|
|
|
location /media/ {
|
2026-03-25 21:17:49 +01:00
|
|
|
proxy_pass http://127.0.0.1:3847;
|
2026-03-25 20:38:29 +01:00
|
|
|
proxy_cache_valid 200 30d;
|
|
|
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Security headers
|
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
|
|
|
|
|
|
|
|
client_max_body_size 50M;
|
|
|
|
|
}
|