From 16ec5625278376c6cd81af1c0175410336b49361 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 16 Nov 2020 15:27:18 +0700 Subject: [PATCH] updated nginx conf --- docker/app/nginx.conf | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docker/app/nginx.conf b/docker/app/nginx.conf index c7232e5a..7fbacbd4 100644 --- a/docker/app/nginx.conf +++ b/docker/app/nginx.conf @@ -8,8 +8,38 @@ http { root /usr/share/nginx/html; include /etc/nginx/mime.types; + gzip on; + gzip_min_length 1000; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain application/xml application/javascript; + + ## All static files will be served directly. + location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|xml|otf|ttf|eot|woff|woff2|svg)$ { + access_log off; + expires 30d; + add_header Cache-Control public; + gzip_static on; + + ## No need to bleed constant updates. Send the all shebang in one + ## fell swoop. + tcp_nodelay off; + + ## Set the OS file cache. + open_file_cache max=3000 inactive=120s; + open_file_cache_valid 45s; + open_file_cache_min_uses 2; + open_file_cache_errors off; + } + location / { - try_files $uri /index.html; + gzip_static on; + try_files $uri @index; + } + + location @index { + add_header Cache-Control "no-store, no-cache, must-revalidate"; + expires -1; + try_files /index.html =404; } } }