From a0643aaf4ef58cd3a2f10f6e1ca7992225d2e945 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Wed, 11 May 2022 10:53:51 +0530 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=94=A7=20improve=20nginx=20cache?= =?UTF-8?q?=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Prashant Shahi --- deploy/docker-swarm/common/nginx-config.conf | 9 +++++++-- deploy/docker/common/nginx-config.conf | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/deploy/docker-swarm/common/nginx-config.conf b/deploy/docker-swarm/common/nginx-config.conf index 55a780e0f3..3153dff62f 100644 --- a/deploy/docker-swarm/common/nginx-config.conf +++ b/deploy/docker-swarm/common/nginx-config.conf @@ -12,13 +12,18 @@ server { gzip_http_version 1.1; location / { - add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0"; - add_header Last-Modified $date_gmt; + if ( $uri = '/index.html' ) { + add_header Cache-Control no-store always; + } root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html; } + location /api/alertmanager { + proxy_pass http://alertmanager:9093/api/v2; + } + location /api { proxy_pass http://query-service:8080/api; } diff --git a/deploy/docker/common/nginx-config.conf b/deploy/docker/common/nginx-config.conf index 3444de7808..3153dff62f 100644 --- a/deploy/docker/common/nginx-config.conf +++ b/deploy/docker/common/nginx-config.conf @@ -12,14 +12,15 @@ server { gzip_http_version 1.1; location / { - add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0"; - add_header Last-Modified $date_gmt; + if ( $uri = '/index.html' ) { + add_header Cache-Control no-store always; + } root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html; } - location /api/alertmanager{ + location /api/alertmanager { proxy_pass http://alertmanager:9093/api/v2; }