From 78c575465516999e9abbfa5d07397f0c8675c92e Mon Sep 17 00:00:00 2001 From: 3dtours Date: Tue, 23 Jun 2026 12:46:59 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20l=E1=BB=97i=20xem=20=E1=BA=A3nh=20trong?= =?UTF-8?q?=20Tour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/nginx.conf | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 915cb86..08b10fc 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -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;