From 5698eba6a8539aecb22f0c0585c7e6368ce0810a Mon Sep 17 00:00:00 2001 From: ordinarthur <@arthurbarre.js@gmail.com> Date: Fri, 13 Mar 2026 10:23:05 +0100 Subject: [PATCH] ok prod --- nginx.conf | 6 +++--- server.mjs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 631d60c..64316af 100644 --- a/nginx.conf +++ b/nginx.conf @@ -11,7 +11,7 @@ server { 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_set_header X-Forwarded-Proto https; } # ── SEO (dynamique depuis DB) ──────────────────────────────────────────── @@ -28,12 +28,12 @@ server { } # ── Admin proxy → Fastify (AdminJS) ────────────────────────────────────── - location /admin { + location ^~ /admin { proxy_pass http://127.0.0.1:3001; 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_set_header X-Forwarded-Proto https; } # ── Cache : Astro hashed → immutable ───────────────────────────────────── diff --git a/server.mjs b/server.mjs index c326695..d1bbd22 100644 --- a/server.mjs +++ b/server.mjs @@ -10,7 +10,7 @@ dotenv.config() const stripe = new Stripe(process.env.STRIPE_SECRET_KEY ?? '') const DOMAIN = process.env.DOMAIN ?? 'http://localhost:4321' -const app = Fastify({ logger: true }) +const app = Fastify({ logger: true, trustProxy: true }) await app.register(cors, { origin: '*', methods: ['GET', 'POST'] }) // ── Webhook Stripe (AVANT AdminJS pour éviter les conflits de body parsing) ─