fix: lỗi xem ảnh trong Tour
This commit is contained in:
+11
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user