webinoly/templates/nginx/common/wpcommon.conf
Cristhian Martínez Ochoa e0f7aeaf03 templates and conf updated
Nginx Conf updated.
More protection to prevent DOS attacks.
Skip cache for more cart and sitemap plugins.
2018-06-22 08:53:29 -06:00

54 lines
1.6 KiB
Plaintext

# WordPress COMMON SETTINGS
# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE Webinoly
# Limit access to avoid brute force attack
# https://baraktawily.blogspot.com/2018/02/how-to-dos-29-of-world-wide-websites.html
location = /wp-admin/load-styles.php {
limit_req zone=one burst=1 nodelay;
include common/acl.conf;
include fastcgi_params;
fastcgi_pass php;
}
location = /wp-admin/load-scripts.php {
limit_req zone=one burst=1 nodelay;
include common/acl.conf;
include fastcgi_params;
fastcgi_pass php;
}
location = /wp-login.php {
limit_req zone=one burst=1 nodelay;
include common/acl.conf;
include fastcgi_params;
fastcgi_pass php;
}
# Disable wp-config.txt
location = /wp-config.txt {
deny all;
access_log off;
log_not_found off;
}
# Disallow php in upload folder
location /wp-content/uploads/ {
location ~ \.php$ {
#Prevent Direct Access Of PHP Files From Web Browsers
deny all;
}
}
# YoastSitemapStart - Yoast SEO Plugin
location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
rewrite ^(.*)/sitemap\.xml$ $1/sitemap_index.xml permanent;
rewrite ^.*/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last;
# Rules for yoast sitemap with wp|wpsubdir|wpsubdomain
rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# Following lines are optional. Needed for Yoast Premium.
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;
}
# YoastSitemapEnd