server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # API proxy location /api/ { proxy_pass http://family-wishlist-backend:3000/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; proxy_set_header Connection ""; client_max_body_size 10m; } # Uploaded files (images) location ^~ /uploads/ { proxy_pass http://family-wishlist-backend:3000/uploads/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_cache_valid 200 1h; } # Static files with long cache location ~* \.(?:js|css|woff2?|svg|png|jpg|jpeg|gif|webp|ico)$ { expires 7d; add_header Cache-Control "public"; try_files $uri =404; } # SPA fallback location / { try_files $uri /index.html; } }