server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Vue Router history mode location / { try_files $uri $uri/ /index.html; } # API proxy location /api/ { proxy_pass http://dashboard-api:3200; 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; } # Gzip gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml; gzip_min_length 1000; # Cache static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ { expires 30d; add_header Cache-Control "public, immutable"; } }