Aggiorna la configurazione di Nginx per supportare Vue.js e migliora la gestione degli errori
GKE Deploy / build-and-deploy (push) Successful in 22s

This commit is contained in:
2026-01-28 17:56:03 +01:00
parent 6852128ef8
commit a33d8d8e63
+26 -26
View File
@@ -1,30 +1,30 @@
server { user nginx;
listen 80; worker_processes 1;
server_name localhost; error_log /var/log/nginx/error.log warn;
root /usr/share/nginx/html; pid /var/run/nginx.pid;
index index.html; events {
worker_connections 1024;
# Gzip compression }
gzip on; http {
gzip_vary on; include /etc/nginx/mime.types;
gzip_min_length 10240; default_type application/octet-stream;
gzip_proxied expired no-cache no-store private auth; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json; '$status $body_bytes_sent "$http_referer" '
gzip_disable "MSIE [1-6]\."; '"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
# Gestione delle rotte per SPA sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / { location / {
try_files $uri $uri/ /index.html; root /app;
index index.html;
try_files $uri $uri/ /index.html; # <--- LA MAGIA PER VUE.JS
} }
error_page 500 502 503 504 /50x.html;
# Cache per asset statici location = /50x.html {
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|svg|woff|woff2|ttf|eot)$ { root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public, immutable";
} }
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
} }