Skip to content

Commit

Permalink
avoid regex location for webmanifest
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Mar 23, 2024
1 parent b66c3d8 commit 19b5bb1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ http {
try_files $uri.html =404;
}

location = /manifest.webmanifest {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Cache-Control "public, max-age=604800";
}

location = /favicon.ico {
if ($http_accept ~ "image/svg\+xml") {
rewrite ^ /favicon.svg last;
Expand Down Expand Up @@ -349,12 +355,6 @@ http {
add_header Cache-Control "public, max-age=31536000";
}

location ~ "\.webmanifest$" {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Cache-Control "public, max-age=604800";
}

location ~ "\.png$" {
include snippets/security-headers.conf;
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880
Expand Down

0 comments on commit 19b5bb1

Please sign in to comment.