diff --git a/per-site/cache.conf b/per-site/cache.conf deleted file mode 100644 index a5f7d9d..0000000 --- a/per-site/cache.conf +++ /dev/null @@ -1,22 +0,0 @@ -# cache.appcache, your document html and data -location ~* \.(?:manifest|appcache|html?|xml|json)$ { - expires -1; -} - -# Feed -location ~* \.(?:rss|atom)$ { - expires 1h; - add_header Cache-Control "public"; -} - -# Media: images, icons, video, audio, HTC -location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { - expires 1y; - add_header Cache-Control "public"; -} - -# CSS and Javascript -location ~* \.(?:css|js)$ { - expires 1y; - add_header Cache-Control "public"; -} \ No newline at end of file diff --git a/per-site/exclusions.conf b/per-site/exclusions.conf index 8f02dce..19fb359 100644 --- a/per-site/exclusions.conf +++ b/per-site/exclusions.conf @@ -9,22 +9,4 @@ location ~ /\. { # Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban) location ~* /(?:uploads|files)/.*\.php$ { deny all; -} - -# Don't record error/access logs for favicon.io. -location = /favicon.ico { - log_not_found off; - access_log off; -} - -# Don't record error/access logs for robots.txt. -location = /robots.txt { - log_not_found off; - access_log off; -} - -# Don't record error/access logs for static assets. -location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js)$ { - log_not_found off; - access_log off; } \ No newline at end of file diff --git a/per-site/static-files.conf b/per-site/static-files.conf new file mode 100644 index 0000000..626b57f --- /dev/null +++ b/per-site/static-files.conf @@ -0,0 +1,32 @@ +# Don't cache appcache, document html and data. +location ~* \.(?:manifest|appcache|html?|xml|json)$ { + expires -1; +} + +# Cache RSS and Atom feeds. +location ~* \.(?:rss|atom)$ { + expires 1h; + add_header Cache-Control "public"; +} + +# Caches images, icons, video, audio, HTC, etc. +location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { + expires 1y; + add_header Cache-Control "public"; + + # Comment out these lines if you wish to record access/error logs for static files. + log_not_found off; + access_log off; +} + +# Cache CSS and JavaScript. +location ~* \.(?:css|js)$ { + expires 1y; + add_header Cache-Control "public"; +} + +# Don't record access/error logs for robots.txt. +location = /robots.txt { + log_not_found off; + access_log off; +} \ No newline at end of file diff --git a/sites-available/fastcgi-cache.com b/sites-available/fastcgi-cache.com index fbfdef1..086308b 100644 --- a/sites-available/fastcgi-cache.com +++ b/sites-available/fastcgi-cache.com @@ -23,8 +23,8 @@ server { # Exclusions include per-site/exclusions.conf; - # Cache static content - include per-site/cache.conf; + # Static content + include per-site/static-files.conf; # Fastcgi cache rules include per-site/fastcgi-cache.conf; diff --git a/sites-available/multisite-subdirectory.com b/sites-available/multisite-subdirectory.com index d40bfd0..e16575f 100644 --- a/sites-available/multisite-subdirectory.com +++ b/sites-available/multisite-subdirectory.com @@ -18,8 +18,8 @@ server { # Exclusions include per-site/exclusions.conf; - # Cache static content - include per-site/cache.conf; + # Static content + include per-site/static-files.conf; location / { try_files $uri $uri/ /index.php?$args; diff --git a/sites-available/multisite-subdomain.com b/sites-available/multisite-subdomain.com index 9dcca82..ad989b5 100644 --- a/sites-available/multisite-subdomain.com +++ b/sites-available/multisite-subdomain.com @@ -18,8 +18,8 @@ server { # Exclusions include per-site/exclusions.conf; - # Cache static content - include per-site/cache.conf; + # Static content + include per-site/static-files.conf; location / { try_files $uri $uri/ /index.php?$args; diff --git a/sites-available/singlesite.com b/sites-available/singlesite.com index 446562f..1750162 100644 --- a/sites-available/singlesite.com +++ b/sites-available/singlesite.com @@ -18,8 +18,8 @@ server { # Exclusions include per-site/exclusions.conf; - # Cache static content - include per-site/cache.conf; + # Static content + include per-site/static-files.conf; location / { try_files $uri $uri/ /index.php?$args; diff --git a/sites-available/ssl.com b/sites-available/ssl.com index 142c296..23d73c8 100644 --- a/sites-available/ssl.com +++ b/sites-available/ssl.com @@ -23,8 +23,8 @@ server { # Exclusions include per-site/exclusions.conf; - # Cache static content - include per-site/cache.conf; + # Static content + include per-site/static-files.conf; # SSL rules include per-site/ssl.conf;