rebours/nginx.conf
ordinarthur 1b53e04b5d feat: switch to SSR for live Sanity updates
Migrate from SSG to SSR with @astrojs/node adapter so Sanity CMS
changes are reflected immediately without rebuild. Separate ports
for Astro SSR (4321) and Fastify API (3000) in production.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 11:41:34 +02:00

34 lines
1.4 KiB
Nginx Configuration File
Raw Blame History

server {
listen 80;
server_name rebours.studio;
# ── API proxy → Fastify ────────────────<E29480><E29480><EFBFBD>─────────────────────────────────
location /api/ {
proxy_pass http://127.0.0.1:3000;
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 https;
}
# ── Static assets from Astro client build ──────────────────<E29480><E29480><EFBFBD>─────────────
location /_astro/ {
root /var/www/html/rebours/dist/client;
add_header Cache-Control "public, max-age=31536000, immutable";
}
location ~* \.(css|js|jpg|jpeg|png|gif|webp|svg|woff2|woff|ttf|ico|mp3)$ {
root /var/www/html/rebours/dist/client;
add_header Cache-Control "public, max-age=604800";
}
# ── SSR → Astro Node server ─────────────────────<E29480><E29480><EFBFBD>────────────────────────
location / {
proxy_pass http://127.0.0.1:4321;
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 https;
}
}