← back to Kamatera Nginx
sites-available/wholivedthere.com.conf
47 lines
# HTTP → HTTPS redirect
server {
listen 80;
server_name wholivedthere.com www.wholivedthere.com;
return 301 https://$host$request_uri;
}
# HTTPS → Next.js
server {
listen 443 ssl http2;
server_name wholivedthere.com www.wholivedthere.com;
ssl_certificate /etc/letsencrypt/live/wholivedthere.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wholivedthere.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
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;
add_header Permissions-Policy "geolocation=(self), microphone=(), camera=()" always;
# Site Factory routes (Stripe + auth + health + webhook + claim) → SF port 3091
location ~ ^/api/(auth|checkout|health|webhook)(/|$) {
proxy_pass http://127.0.0.1:3091;
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_http_version 1.1;
# Stripe webhook sig verify needs raw body
proxy_request_buffering off;
}
# Everything else → pastdoor (port 9821)
location / {
proxy_pass http://127.0.0.1:9821;
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_http_version 1.1;
}
}