fix: prevent header wrapping and uploaded image 404s

This commit is contained in:
Vaka.pro
2026-04-27 21:29:47 +03:00
parent 0ada42017f
commit fbf1d2d02f
5 changed files with 43 additions and 16 deletions

View File

@@ -4,13 +4,6 @@ server {
root /usr/share/nginx/html;
index index.html;
# 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;
}
# API proxy
location /api/ {
proxy_pass http://family-wishlist-backend:3000/api/;
@@ -24,13 +17,20 @@ server {
}
# Uploaded files (images)
location /uploads/ {
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;