Skip to content

Commit

Permalink
build(cache): attempt to fix caching headers
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispymm committed Nov 28, 2024
1 parent 2fbc4fe commit a8b5440
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docker/nginx-staging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ server {
gzip_comp_level 5;
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml;

location / {
root /usr/share/nginx/html;
index index.html index.htm;

auth_basic "Staging site";
auth_basic_user_file /etc/nginx/.htpasswd;
}

location ~* \.(html)$ {
etag off;
if_modified_since off;
add_header Cache-Control "no-cache"
}

location ~* \.(ico|jpg|jpeg|png|js|css|woff|woff2)$ {
etag off;
if_modified_since off;
add_header Cache-Control "public max-age=31536000 immutable"
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;

auth_basic "Staging site";
auth_basic_user_file /etc/nginx/.htpasswd;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
Expand Down

0 comments on commit a8b5440

Please sign in to comment.