Update nginx.conf

This commit is contained in:
Baobhan Sith
2025-04-30 10:36:54 +08:00
parent 42f0ba9e81
commit 27591bee91
+12 -1
View File
@@ -29,10 +29,21 @@ server {
proxy_set_header Connection "upgrade";
}
# Proxy uploaded files requests to the backend service
location /uploads/ {
proxy_pass http://backend:3001; # Proxy to backend root
# Standard proxy headers
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;
}
# Optional: Add headers for caching, security, etc.
# Example: Cache assets aggressively
location ~* \.(?:css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public";
}
}
}