From 1de38f40ccb5ad1ea4e9f4b71cc0ac30b675a0dc Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 5 Jan 2026 02:54:50 +0300 Subject: [PATCH] fix --- nginx.conf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index b68af8b..d94524f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -21,21 +21,23 @@ server { add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; - # SPA routing support - все запросы направляются на index.html - location / { - try_files $uri $uri/ /index.html; - } - - # Кэширование статических ресурсов + # Кэширование статических ресурсов (должен быть перед location /) location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + try_files $uri =404; expires 1y; add_header Cache-Control "public, immutable"; } # Не кэшируем HTML location ~* \.html$ { + try_files $uri =404; expires -1; add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; } + + # SPA routing support - все запросы направляются на index.html (должен быть последним) + location / { + try_files $uri $uri/ /index.html; + } }