fix
This commit is contained in:
parent
aa706ba535
commit
1de38f40cc
1 changed files with 8 additions and 6 deletions
14
nginx.conf
14
nginx.conf
|
|
@ -21,21 +21,23 @@ server {
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||||
|
|
||||||
# SPA routing support - все запросы направляются на index.html
|
# Кэширование статических ресурсов (должен быть перед location /)
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Кэширование статических ресурсов
|
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
try_files $uri =404;
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Не кэшируем HTML
|
# Не кэшируем HTML
|
||||||
location ~* \.html$ {
|
location ~* \.html$ {
|
||||||
|
try_files $uri =404;
|
||||||
expires -1;
|
expires -1;
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue