nginx: change regex patterns to non-capturing for speedup
This commit is contained in:
parent
b39dfb59fd
commit
a8679c18b7
|
@ -5,6 +5,6 @@
|
|||
# Read also this: github.com/h5bp/html5-boilerplate/wiki/cachebusting
|
||||
# This is not included by default, because it'd be better if you use the build
|
||||
# script to manage the file names.
|
||||
location ~* (.+)\.(\d+)\.(js|css|png|jpg|jpeg|gif)$ {
|
||||
try_files $uri $1.$3;
|
||||
location ~* (.+)\.(?:\d+)\.(js|css|png|jpg|jpeg|gif)$ {
|
||||
try_files $uri $1.$2;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Cross domain webfont access
|
||||
location ~* \.(ttf|ttc|otf|eot|woff|font.css)$ {
|
||||
location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
|
||||
add_header "Access-Control-Allow-Origin" "*";
|
||||
|
||||
# Also, set cache rules for webfonts.
|
||||
|
|
|
@ -36,7 +36,7 @@ location ~* \.(?:css|js)$ {
|
|||
|
||||
# WebFonts
|
||||
# If you are NOT using cross-domain-fonts.conf, uncomment the following directive
|
||||
# location ~* \.(ttf|ttc|otf|eot|woff|font.css)$ {
|
||||
# location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
|
||||
# expires 1M;
|
||||
# access_log off;
|
||||
# add_header Cache-Control "public";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Prevent clients from accessing hidden files (starting with a dot)
|
||||
location ~* (^|/)\. {
|
||||
location ~* (?:^|/)\. {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# Prevent clients from accessing to backup/config/source files
|
||||
location ~* (\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$ {
|
||||
location ~* (?:\.(?:bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$ {
|
||||
return 403;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue