From 847901aaa25241fcc99ed2e01b6ca293c83ae3ba Mon Sep 17 00:00:00 2001 From: Mathieu JESER <6737167+bobdivx@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:40:03 +0100 Subject: [PATCH] =?UTF-8?q?fix(static):=20redirections=20nginx=20relatives?= =?UTF-8?q?=20(=C3=A9vite=20http://=20derri=C3=A8re=20le=20proxy=20TLS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le pack statique sert les sites avec la config nginx:alpine par défaut. Derrière le proxy TLS, nginx reçoit du http : /apps/x (dossier sans barre finale) renvoyait 301 Location: http://jeser.app/apps/x/, puis erreur 500 sur le port 80. absolute_redirect off produit Location: /apps/x/, qui reste en https côté navigateur. --- crates/deploy/src/docker.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/deploy/src/docker.rs b/crates/deploy/src/docker.rs index feef21d20..58b8b0185 100644 --- a/crates/deploy/src/docker.rs +++ b/crates/deploy/src/docker.rs @@ -377,6 +377,9 @@ RUN npm run build \ && cp -a "$src"/. /devforge-static/ FROM nginx:alpine +# Redirections relatives (`/apps/x` → `Location: /apps/x/`) : derrière le proxy +# TLS, nginx reçoit du http et générerait sinon `http://hôte/apps/x/`. +RUN printf 'absolute_redirect off;\n' > /etc/nginx/conf.d/00-devforge-redirect.conf COPY --from=build /devforge-static /usr/share/nginx/html EXPOSE 80 "#, @@ -1621,6 +1624,10 @@ mod tests { assert!(static_df.contains(".vercel/output/static")); assert!(static_df.contains("COPY --from=build /devforge-static")); assert!(!static_df.contains("COPY --from=build /app/dist")); + assert!( + static_df.contains("absolute_redirect off;"), + "redirections relatives attendues : {static_df}" + ); } #[test]