Files
PRISM/frontend/nginx.conf
T
boris.waaubandClaude Sonnet 5.5 7d91828da9
Deploy test / deploy (push) Successful in 1m34s
nginx : sert les fichiers .mjs en text/javascript (worker MapLibre bloqué)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 15:50:20 +01:00

36 lines
1.0 KiB
Nginx Configuration File

server {
listen 8080;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Le worker de MapLibre est un module .mjs : le navigateur refuse tout autre type MIME.
include /etc/nginx/mime.types;
types {
text/javascript mjs;
}
# Le back-end tourne dans le même pod que ce conteneur.
location ~ ^/(api|admin|static)/ {
proxy_pass http://127.0.0.1:8000;
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 $http_x_forwarded_proto;
proxy_read_timeout 60s;
}
# Fichiers versionnés par Vite : cache long.
location /assets/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Application monopage : toute autre route retombe sur index.html.
location / {
try_files $uri /index.html;
add_header Cache-Control "no-cache";
}
}