fix: lỗi xem ảnh trong Tour

This commit is contained in:
2026-06-23 12:46:59 +07:00
parent 5145835c8a
commit 78c5754655
+11 -10
View File
@@ -3,6 +3,15 @@ server {
server_name yotrip.labz.io.vn localhost;
client_max_body_size 50M;
# Proxy uploaded files from backend (MUST come before image pattern matching)
location /uploads/ {
proxy_pass http://backend:3001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
add_header Cache-Control "public, max-age=31536000";
}
# JavaScript and CSS files - immutable caching
location ~* \.(?:js|css)$ {
root /usr/share/nginx/html;
@@ -12,8 +21,8 @@ server {
access_log off;
}
# Images and fonts - long caching
location ~* \.(?:jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
# Images and fonts - long caching (NOT including /uploads/)
location ~* ^(?!/uploads/).*\.(?:jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public, max-age=31536000";
@@ -39,14 +48,6 @@ server {
proxy_cache_bypass $http_upgrade;
}
# Serve uploaded files from backend
location /uploads/ {
proxy_pass http://backend:3001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Proxy WebSocket connection
location /socket.io/ {
proxy_pass http://backend:3001;