26 lines
1.1 KiB
Nginx Configuration File
26 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# ── Proxy vers le backend Vert.x ─────────────────────────────────────────
|
|
# Toutes les routes /api/* sont proxifiées vers le backend Vert.x
|
|
location /api/ {
|
|
proxy_pass http://vigimeteo-backend-service:8888;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
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;
|
|
# ✅ CRITIQUE : Transmettre le token JWT au backend
|
|
proxy_set_header Authorization $http_authorization;
|
|
proxy_pass_header Authorization;
|
|
}
|
|
|
|
# ── Frontend SPA ──────────────────────────────────────────────────────────
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|