2014-09-07 21:51:34 +02:00
|
|
|
|
|
|
|
# try for WordPress index.php in /
|
|
|
|
# fall back to index.php + args (passed to php5-fpm later)
|
2014-11-06 22:41:07 +01:00
|
|
|
# also serves static files from the disk instead of passing to interpreter,
|
2014-09-07 21:51:34 +02:00
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ /index.php?$args;
|
|
|
|
}
|
|
|
|
|
2016-03-12 18:17:40 +01:00
|
|
|
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ {
|
2014-11-06 22:29:53 +01:00
|
|
|
add_header Cache-Control "public, max-age=604800";
|
2014-10-10 10:05:42 +02:00
|
|
|
}
|
|
|
|
|
2014-09-07 21:51:34 +02:00
|
|
|
# Add trailing slash to */wp-admin requests.
|
|
|
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
|
|
|
|
2015-02-26 15:05:50 +01:00
|
|
|
# Deny access to any files with a .php extension in the uploads directory
|
|
|
|
# Works in sub-directory installs and also in multisite network
|
|
|
|
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
|
|
|
|
location ~* /(?:uploads|files)/.*\.php$ {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
2015-01-23 10:26:24 +01:00
|
|
|
# Yoast SEO plugin
|
|
|
|
# https://yoast.com/wordpress/plugins/seo/
|
|
|
|
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
|
|
|
|
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
|
|
|
|
|