Improve static files logic
This commit is contained in:
parent
77bc5ab452
commit
4ffe1a88cf
@ -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";
|
||||
}
|
||||
@ -10,21 +10,3 @@ location ~ /\. {
|
||||
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;
|
||||
}
|
||||
32
per-site/static-files.conf
Normal file
32
per-site/static-files.conf
Normal file
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user