Skip to content

Commit

Permalink
don't use a media Fallback for static assets ( 1461 ) (#1480)
Browse files Browse the repository at this point in the history
removes media Fallback in nginx for:

/theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /recovery/* /sitemap/*

With this, fallback handling, is the same as on caddy
  • Loading branch information
jonashrem authored Sep 15, 2024
1 parent 15da699 commit 51cdba0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions resources/references/config-reference/server/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ server {
}
}
location ~ ^/(theme|media|thumbnail|bundles|css|fonts|js|recovery|sitemap)/ {
expires 1y;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
log_not_found off;
tcp_nodelay off;
open_file_cache max=3000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
location ~* ^.+\.svg {
add_header Content-Security-Policy "script-src 'none'";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
log_not_found off;
}
}
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|html|woff|woff2|xml)$ {
expires 1y;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
Expand Down

0 comments on commit 51cdba0

Please sign in to comment.