Files
mitigation/nginx.conf
2025-08-18 15:21:46 +00:00

46 lines
989 B
Nginx Configuration File

location ~ ^/(wp-cron\.php|wp-config\.php|install\.php|xmlrpc\.php|config\.php|configuration\.php|\.env|\.git/|\.svn/|\.log$) {
# deny all;
return 404;
# rewrite ^(.*)$ /error-404/ redirect;
# add_header X-Status 404;
# rewrite ^(.*)$ /error-404/ last;
}
error_page 404 /error-404/;
location ~ (LICENSE|\.md$|license\.txt|\.htaccess|readme\.html|readme\.txt) {
log_not_found off;
access_log off;
return 404;
# rewrite ^(.*)$ /error-404/ last;
}
location ~* ^/wp-json/wp/v2/users(/.*)?$ {
return 404;
# rewrite ^(.*)$ /error-404/ last;
}
# Direct PHP File Access
location ~* /(?:uploads|files|wp-content|wp-includes|akismet)/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* /xmlrpc.php$ {
allow 172.0.1.1;
allow 192.0.0.0/16;
deny all;
}