57 lines
2.2 KiB
Plaintext
57 lines
2.2 KiB
Plaintext
server {
|
|
listen 8001;
|
|
server_name localhost;
|
|
root /opt/msp/isp-admin-ui/;
|
|
|
|
location / {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header Pragma "no-cache"; # Для совместимости с HTTP/1.0
|
|
expires off;
|
|
try_files $uri __PUBLIC_PATH__/index.html;
|
|
}
|
|
|
|
location /api {
|
|
client_max_body_size 10M;
|
|
|
|
proxy_pass http://isp-gate-service:9003;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
location /assets/ {
|
|
gzip on;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 256;
|
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
|
gzip_vary on;
|
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
|
|
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
|
}
|
|
|
|
# Кэширование для шрифтов и изображений (1 неделя)
|
|
location ~* \.(?:ico|png|jpg|jpeg|svg|gif|webp|ttf|woff|woff2|otf|eot)$ {
|
|
gzip on;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 256;
|
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
|
gzip_vary on;
|
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
|
|
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
|
}
|
|
|
|
# Кэширование JS и CSS (1 неделя)
|
|
location ~* \.(?:js|css)$ {
|
|
gzip on;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 256;
|
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
|
gzip_vary on;
|
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
|
|
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
|
}
|
|
}
|
|
|