Skip to content

Commit

Permalink
Merge pull request #188 from zerotier/cache-settings
Browse files Browse the repository at this point in the history
add better caching of assets for docs site
  • Loading branch information
glimberg authored Aug 29, 2024
2 parents 37bd082 + 51028d3 commit 7f2d7b1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ server {
# Otherwise it strips off the scheme & port number.
absolute_redirect off;

location ~* ^\/assets\/(css|js)\/.+\.(css|less|js)$ {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'public, max-age=86400';
add_header X-Frame-Options "SAMEORIGIN" always;
if_modified_since before;
etag on;
}

location ~* \.(jpg|jpeg|png|svg|gif|ico|swf|eot|ttf|woff|woff2|ot) {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'public, max-age=86400';
add_header X-Frame-Options "SAMEORIGIN" always;
if_modified_since before;
etag on;
}

location ~* \.(html)$ {
etag on;
add_header Cache-Control "no-cache";
add_header X-Frame-Options "SAMEORIGIN" always;
}

location ~ ^/zerotier/microsegmentation(/?)$ {
return 301 /microsegmentation;
}
Expand Down

0 comments on commit 7f2d7b1

Please sign in to comment.