Refactor environment and nginx configuration for improved API routing and proxy handling

This commit is contained in:
Vincent Guillet
2025-11-26 15:14:53 +01:00
parent 8cdfab9596
commit b16eff2e76
4 changed files with 24 additions and 144 deletions

View File

@@ -4,10 +4,31 @@ server {
server_name _;
# Angular packagé par Nginx (classique)
root /usr/share/nginx/html;
index index.html;
# SPA Angular : toutes les routes front -> index.html
location / {
try_files $uri $uri/ /index.html;
}
}
# === Proxy vers PrestaShop (équivalent proxy.conf.json "/ps") ===
location /ps/ {
# /ps/... -> https://shop.gameovergne.fr/api/...
proxy_pass https://shop.gameovergne.fr/api/;
# changeOrigin: true
proxy_set_header Host shop.gameovergne.fr;
# Auth Basic comme dans ton proxy.conf.json Angular
proxy_set_header Authorization "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI=";
# HTTPS correct (SNI)
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;
}
}