diff --git a/CHANGELOG.md b/CHANGELOG.md index 402fc5e..745b81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Nginx-Craft Changelog +## 1.0.25 - 2020.06.15 +### Changed +* Route any 404s for `expires.conf` matches back through Craft for handling + ## 1.0.24 - 2020.05.14 ### Added * Added `always` to all of the added headers in `security.conf` so that they are added regardless of response code diff --git a/nginx-partials/expires.conf b/nginx-partials/expires.conf index e4302bb..2d8abd6 100644 --- a/nginx-partials/expires.conf +++ b/nginx-partials/expires.conf @@ -19,6 +19,8 @@ location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp3|mp4|ogg|ogv|webm|htc|w etag off; expires 1M; access_log off; + # Route any 404s back through Craft + try_files $uri /index.php?$query_string; # max-age=2592000 = 1 month in seconds, stale-while-revalidate=86400 = 1 day in seconds add_header Cache-Control "public, max-age=2592000, must-revalidate, stale-while-revalidate=86400"; } @@ -28,6 +30,8 @@ location ~* \.(?:css|js)$ { etag off; expires 1y; access_log off; + # Route any 404s back through Craft + try_files $uri /index.php?$query_string; # max-age=31556952 = 1 year in seconds add_header Cache-Control "public, max-age=31556952, immutable"; } @@ -38,6 +42,8 @@ location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header "Access-Control-Allow-Origin" "*"; expires 1M; access_log off; + # Route any 404s back through Craft + try_files $uri /index.php?$query_string; # max-age=2592000 = 1 month in seconds, stale-while-revalidate=86400 = 1 day in seconds add_header Cache-Control "public, max-age=2592000, must-revalidate, stale-while-revalidate=86400"; }