From b7d90b190210a61e49029bd351ac1fb02c7f5286 Mon Sep 17 00:00:00 2001 From: frakarr Date: Sun, 7 Dec 2025 20:30:55 +0100 Subject: [PATCH] Update nginx.conf --- nginx.conf | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 97684f0..8645875 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1 +1,38 @@ -���z \ No newline at end of file +worker_processes 1; + +events { worker_connections 1024; } + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + # Limite upload per allegati (es. foto/video ticket) + client_max_body_size 50M; + + server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + # Compressione Gzip + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + # Gestione SPA (React Router) + location / { + try_files $uri $uri/ /index.html; + } + + # Proxy API verso il backend + location /api/ { + proxy_pass http://backend:3001; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + } +}