49 lines
1.6 KiB
Nginx Configuration File
49 lines
1.6 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Upload max : aligné sur la limite multipart du Core (64 Mo). Couvre les
|
|
# imports/adaptations de PDF (livres de règles/campagne illustrés) et les images.
|
|
client_max_body_size 64M;
|
|
|
|
location /api/ {
|
|
proxy_pass http://core:8080/api/;
|
|
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;
|
|
|
|
# Streaming SSE (chat, import, adaptation) : pas de buffering, et timeouts
|
|
# longs car une génération sur gros PDF peut tarder avant le 1er octet.
|
|
proxy_buffering off;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
}
|
|
|
|
# index.html : toujours revalide. Empeche un navigateur qui a precedemment
|
|
# visite une autre instance LoreMind (demo en ligne, dev local, etc.) de
|
|
# servir une vieille version cachee a la place de l'app reelle.
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
|
|
add_header Pragma "no-cache" always;
|
|
expires 0;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Assets Angular avec hash dans le nom (main.<hash>.js, etc.) :
|
|
# immuables, peuvent etre caches longtemps.
|
|
location ~* \.(?:js|css|woff2?|ttf|svg|png|jpg|jpeg|webp|ico)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|