DEVOPS-1898 fixes from Pavel

This commit is contained in:
Халтобин Евгений 2025-01-24 14:07:15 +03:00
parent 961ba3b4de
commit 44f9351cde

View file

@ -17,6 +17,7 @@ http {
sendfile on; sendfile on;
server_tokens off; server_tokens off;
gzip on; gzip on;
# text/html doesn't need to be defined there, it's compressed always # text/html doesn't need to be defined there, it's compressed always
@ -34,7 +35,7 @@ http {
server { server {
listen 80 default; listen 80 default;
access_log /var/log/nginx/access.log nginx_main; access_log /var/log/nginx/access.log nginx_main;
error_log /var/log/nginx/error.log error; error_log /var/log/nginx/error.log error;
charset utf-8; charset utf-8;
@ -76,43 +77,44 @@ http {
text/xml; text/xml;
location / { location / {
root /frontend; root /frontend;
index index.html; index index.html;
try_files $uri @index; try_files $uri @index;
add_header Content-Security-Policy "frame-ancestors 'none'; default-src 'self'; script-src 'self'; style-src 'unsafe-inline' 'self' data:; font-src 'self' data:; img-src 'self' data:;"; add_header Content-Security-Policy "frame-ancestors 'none'; default-src 'self'; script-src 'self'; style-src 'unsafe-inline' 'self' data:; font-src 'self' data:; img-src 'self' data:;";
#Application config #Application config
location = /src/resources/app-config.json { location = /src/resources/app-config.json {
add_header Cache-Control "no-cache"; add_header Cache-Control "no-cache";
expires 0; expires 0;
} }
# Media: images, icons, video, audio, HTC # Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff|ttf)$ { location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff|ttf)$ {
expires 1M; expires 1M;
access_log off; access_log off;
# max-age must be in seconds # max-age must be in seconds
add_header Cache-Control "max-age=2629746, public"; add_header Cache-Control "max-age=2629746, public";
} }
# CSS and Javascript # CSS and Javascript
location ~* \.(?:css|js)$ { location ~* \.(?:css|js)$ {
expires 1y; expires 1y;
access_log off; access_log off;
add_header Cache-Control "max-age=31556952, public"; add_header Cache-Control "max-age=31556952, public";
} }
} }
location @index { location @index {
root /frontend; root /frontend;
add_header Cache-Control "no-cache"; add_header Cache-Control "no-cache";
expires 0; add_header Content-Security-Policy "frame-ancestors 'none'; default-src 'self'; script-src 'self'; style-src 'unsafe-inline' 'self' data:; font-src 'self' data:; img-src 'self' data:;";
try_files /index.html =404; expires 0;
try_files /index.html =404;
} }
location = /health { location = /health {
access_log off; access_log off;
add_header 'Content-Type' 'application/json'; add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}'; return 200 '{"status":"UP"}';
} }
} }
} }