Files
Imago/imago-admin/nginx/default.conf
T
bruno 90b94e653e
CI / Lint & Format (push) Failing after 16s
CI / Tests (push) Has been skipped
CI / Security Scan (push) Failing after 17s
CI / Docker Build (push) Has been skipped
refactor: backend port 8000 → 7000 pour eviter conflits applicatifs
- Dockerfile: EXPOSE + CMD uvicorn --port 7000
- app/config.py: PORT default 8000 → 7000
- nginx default.conf: 6x proxy_pass backend:8000 → backend:7000
- docker-compose.prod.yml: BACKEND_PORT default 8001 → 7000, internal 7000
- docker-compose.yml (dev): 8000:8000 → 7000:7000
- imago-admin/docker-compose.yml: VITE_API_BASE_URL + port mapping → 7000
- .env.example: BACKEND_PORT=8001 → 7000
- deploy.sh: defaults + invites port 8001 → 7000
2026-08-06 11:40:18 -04:00

59 lines
1.7 KiB
Plaintext

server {
listen 80;
listen [::]:80;
root /usr/share/nginx/html;
index index.html;
# SPA fallback — toutes les routes vers index.html
location / {
try_files $uri $uri/ /index.html;
}
# Proxy vers le backend pour les routes API (v1 et Admin)
location /api/ {
proxy_pass http://backend:7000;
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;
}
# Proxy pour les fichiers signés (thumbnails, downloads)
location /files/ {
proxy_pass http://backend:7000;
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;
}
location /admin/api/ {
proxy_pass http://backend:7000;
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;
}
location /ws/ {
proxy_pass http://backend:7000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /health {
proxy_pass http://backend:7000;
}
location /metrics {
proxy_pass http://backend:7000;
}
# Cache agressif pour les assets buildés (hash dans le nom)
location ~* \.(js|css|png|svg|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}