Update client/nginx.conf
This commit is contained in:
@@ -2,31 +2,32 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
# Important : racine définie au niveau du dossier "browser"
|
# Le build Angular est dans ce dossier
|
||||||
root /usr/share/nginx/html/gameovergne/browser;
|
root /usr/share/nginx/html/gameovergne/browser;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Accès à /gameovergne/
|
# === Angular SPA ===
|
||||||
location /gameovergne/ {
|
# Traefik a déjà supprimé /gameovergne, donc ici on sert sur /
|
||||||
alias /usr/share/nginx/html/gameovergne/browser/;
|
|
||||||
try_files $uri $uri/ index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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/;
|
|
||||||
proxy_set_header Host shop.gameovergne.fr;
|
|
||||||
proxy_set_header Authorization "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI=";
|
|
||||||
proxy_ssl_server_name on;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Fallback général (sécurité)
|
|
||||||
location / {
|
location / {
|
||||||
return 301 /gameovergne/;
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# === Proxy PrestaShop ===
|
||||||
|
# Côté Angular, tu appelles /gameovergne/ps/...
|
||||||
|
# Traefik strippe /gameovergne -> Nginx reçoit /ps/...
|
||||||
|
location /ps/ {
|
||||||
|
proxy_pass https://shop.gameovergne.fr/api/;
|
||||||
|
|
||||||
|
# équivalent changeOrigin: true
|
||||||
|
proxy_set_header Host shop.gameovergne.fr;
|
||||||
|
|
||||||
|
# Auth basic comme avant
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user