From bbd1b94524d862a86fcb041c2bb151533474b247 Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Fri, 28 Nov 2025 18:39:45 +0000 Subject: [PATCH] Update client/nginx.conf --- client/nginx.conf | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/client/nginx.conf b/client/nginx.conf index 42016aa..1ee8b9e 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -2,32 +2,31 @@ server { listen 80; server_name _; - # ⚠ Ici on pointe directement sur le dossier "browser" - root /usr/share/nginx/html/browser; + # Important : racine définie au niveau du dossier "browser" + root /usr/share/nginx/html/gameovergne/browser; index index.html; - # === App Angular (SPA) servie à la racine du conteneur === - # Traefik enlève déjà /gameovergne, donc ici on voit "/" - location / { - try_files $uri $uri/ /index.html; + # Accès à /gameovergne/ + location /gameovergne/ { + alias /usr/share/nginx/html/gameovergne/browser/; + try_files $uri $uri/ index.html; } - # === Proxy PrestaShop : /ps/* -> https://shop.gameovergne.fr/api/* === - # Côté navigateur, ton code appelle /gameovergne/ps/... - # Traefik strippe /gameovergne -> Nginx voit /ps/... - location /ps/ { + # Accès direct à /gameovergne (sans slash) + location = /gameovergne { + return 301 /gameovergne/; + } + + # Presta via /gameovergne/ps/ + location /gameovergne/ps/ { proxy_pass https://shop.gameovergne.fr/api/; - - # "changeOrigin: true" proxy_set_header Host shop.gameovergne.fr; - - # Auth Basic comme dans ton ancien proxy.conf.json proxy_set_header Authorization "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI="; - proxy_ssl_server_name on; + } - 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; + # Fallback général (sécurité) + location / { + return 301 /gameovergne/; } } \ No newline at end of file