Merge pull request #1136 from SigNoz/prashant/nginx-cache-improvement

chore: 🔧 improve nginx cache configuration
This commit is contained in:
Ankit Nayan 2022-05-17 10:22:20 +02:00 committed by GitHub
commit 38d89fc34a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -12,13 +12,18 @@ server {
gzip_http_version 1.1; gzip_http_version 1.1;
location / { location / {
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0"; if ( $uri = '/index.html' ) {
add_header Last-Modified $date_gmt; add_header Cache-Control no-store always;
}
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /api/alertmanager {
proxy_pass http://alertmanager:9093/api/v2;
}
location /api { location /api {
proxy_pass http://query-service:8080/api; proxy_pass http://query-service:8080/api;
} }

View File

@ -12,14 +12,15 @@ server {
gzip_http_version 1.1; gzip_http_version 1.1;
location / { location / {
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0"; if ( $uri = '/index.html' ) {
add_header Last-Modified $date_gmt; add_header Cache-Control no-store always;
}
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /api/alertmanager{ location /api/alertmanager {
proxy_pass http://alertmanager:9093/api/v2; proxy_pass http://alertmanager:9093/api/v2;
} }