diff --git a/nginx.conf b/nginx.conf index 53612b5..e32f3b4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -21,15 +21,14 @@ server { add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; - # Кэширование статических ресурсов (должен быть перед location /) + # Кэширование статических ресурсов (regex location имеет приоритет) location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { - try_files $uri =404; - access_log off; expires 1y; - add_header Cache-Control "public, immutable" always; + add_header Cache-Control "public, immutable"; + access_log off; } - # SPA routing support - все запросы направляются на index.html + # SPA routing support - все остальные запросы направляются на index.html location / { try_files $uri $uri/ /index.html; }