-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloacations.conf
58 lines (55 loc) · 2.94 KB
/
loacations.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
access_log off;
}
location = /favicon.ico {log_not_found off; access_log off;}
location = /robots.txt {access_log off;log_not_found off;}
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|ttc|css|js|jpg|jpeg|JPG|JPEG|gif|GIF|png|PNG|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|
bmp|rtf|txt|swf)$ {
add_header "Access-Control-Allow-Origin" "*"; add_header Cache-Control "public"; access_log off; log_not_found off; expires 30d;
}
location ~* (.+)\.(?:\d+)\.(js|css)$ {try_files $uri $1.$2;}
location ~ /\.well-known {allow all;}
location ~ /\. {deny all;}
location ~ ~$ {access_log off;log_not_found off;deny all;}
location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ {return 403;access_log off;log_not_found off;}
location = /wp-login.php {limit_req zone=one burst=1 nodelay;include fastcgi_params;fastcgi_pass php;}
location = /wp-config.txt {return 403;access_log off;log_not_found off;}
location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php|pl|exe|asp|js|swf)$ {deny all;}
location ~* /(?:uploads|files)/.*\.php$ {deny all;}
location ~* \.(?:manifest|appcache|html?|xml|json)$ {expires -1;}
location ~* \.(?:rss|atom)$ {expires 1h;}
location ~ /(\.|wp-config.php|readme.html|liesmich.txt|license.txt) {deny all;}
location ~* (roundcube|webdav|smtp|http\:|soap|w00tw00t) {return 444;}
location ~* \.(pl|asp|exe|cgi|py|sh|lua)\$ {return 444;}
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {re
turn 444;}
location = /crossdomain.xml {types {text/x-cross-domain-policy xml;}}
location = /browserconfig.xml {access_log off;log_not_found off;}
location = /xmlrpc.php {return 403;}
location ~ /.well-known/acme-challenge/(.*) {default_type text/plain;add_header "Content-Type: application/jose+json" always;}
location = /RequestDenied {return 406;}
location ~* wp-config.php {deny all;}
location / {try_files $uri $uri/ /index.php?$args;}
location ~ \.php$ {
try_files $uri =404;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass php;
fastcgi_keep_conn on;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 90m;
fastcgi_cache_lock on;
fastcgi_cache_revalidate on;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
# add_header X-Cache-Status $upstream_cache_status;
}