update nginx restriction rules

This commit is contained in:
joglomedia
2019-10-24 00:35:38 +07:00
parent d5168aac93
commit cc31e34af0

View File

@@ -65,7 +65,7 @@ location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ini|log)$ {
}
# Deny access to all packages manager file, such as grunt or composer file.
location ~* (Gruntfile|package|composer)\.(js|json)$ {
location ~* (Gruntfile|package|composer)\.(js|json|lock)$ {
deny all;
access_log off;
log_not_found off;
@@ -81,24 +81,24 @@ location ~* /(?:uploads|files)/.*\.php$ {
}
# Deny access to PHP file in site files directory.
location ~ ^/sites/.*/private/ {
location ~* ^/sites/.*/private/ {
deny all;
}
location ~* ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
# Deny access to WordPress-related stuff.
location ~ (license|readme)\.(html|txt)$ {
deny all;
}
location ~ wp-config.php {
deny all;
}
location ~ readme.html {
deny all;
}
location ~ readme.txt {
deny all;
}
location ~* ^/wp-content/backup-db/ {
location ~ ^/wp-content/backup-db/ {
deny all;
}