diff --git a/client/nginx.conf b/client/nginx.conf index 4b2e7e2..98862b3 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -2,16 +2,24 @@ server { listen 80; server_name _; + # Angular build root /usr/share/nginx/html; index index.html; + # SPA Angular location / { try_files $uri $uri/ /index.html; } + # === Proxy vers PrestaShop (équivalent proxy.conf.json) === location /ps/ { - proxy_pass https://shop.gameovergne.fr/api/; + # Réécrit /ps/ -> /api/ AVANT proxy_pass + rewrite ^/ps/(.*)$ /api/$1 break; + # Envoie vers le FO Presta + proxy_pass https://shop.gameovergne.fr; + + # Host + auth comme en dev proxy_set_header Host shop.gameovergne.fr; proxy_set_header Authorization "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI="; @@ -20,5 +28,8 @@ server { 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; + + # IMPORTANT : on ne laisse PAS passer les redirections vers shop.* + proxy_redirect off; } -} +} \ No newline at end of file