summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2021-05-17 11:16:11 -0400
committerDaniel Micay <danielmicay@gmail.com>2021-05-17 11:16:34 -0400
commit2544be100686acf4c1553372f02938def0103a05 (patch)
treea949c20098cc7b7fe75f72d3da2c21124277a110
parentcf9bc8d45f274941bf5c8b4183fa38b8fe436604 (diff)
reduce cache time for SVG served as /favicon.ico
Cache busting isn't available for /favicon.ico when it isn't fetched for an HTML page.
-rw-r--r--nginx/nginx.conf11
1 files changed, 10 insertions, 1 deletions
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 6a6dbb1c..b62b5633 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -216,7 +216,7 @@ http {
location = /favicon.ico {
if ($http_accept ~ "image/svg\+xml") {
- rewrite ^ /favicon.svg last;
+ rewrite ^ /favicon.ico.svg last;
}
include snippets/security-headers.conf;
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880
@@ -224,6 +224,15 @@ http {
add_header Cache-Control "public, max-age=604800";
}
+ location = /favicon.ico.svg {
+ internal;
+ include snippets/security-headers.conf;
+ # avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880
+ add_header Cross-Origin-Resource-Policy "cross-origin" always;
+ add_header Cache-Control "public, max-age=604800";
+ try_files /favicon.svg =404;
+ }
+
# broken link (now fixed) on https://noagendaphone.com/ with UTF-8 replacement character
location ~ "^/\xEF\xBF\xBC$" {
return 301 /;