From bb18a4757970a6c9c38217ee615cf2b0a3451d68 Mon Sep 17 00:00:00 2001 From: Jewgeni Lewash Date: Sat, 2 Mar 2024 20:20:13 +0100 Subject: [PATCH] feat(nginx): update custom nginx config --- nginx/nginx.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index a6dabab..b451be0 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -22,6 +22,12 @@ http { keepalive_timeout 65; + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + server { listen 80; listen [::]:80; @@ -32,9 +38,21 @@ http { index index.html index.htm; } + try_files $uri $uri/ /index.html + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 30d; + add_header Cache-Control "public, no-transform"; + } + error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } + + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options "nosniff"; + add_header X-XSS-Protection "1; mode=block"; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; } }