Update nginx.conf

This commit is contained in:
fcarraUniSa
2026-02-17 00:21:26 +01:00
committed by GitHub
parent f8f245a613
commit e5b5b8ff83

View File

@@ -1,13 +1,19 @@
server {
listen 80;
# Compressione Gzip per performance
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# Importante per React Router: se il file non esiste, serve index.html
try_files $uri $uri/ /index.html;
}
location /api {
# 'backend' è il nome del servizio nel docker-compose
proxy_pass http://backend:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;