Skip to content

Instantly share code, notes, and snippets.

@olkitu olkitu/nginx.conf
Created Mar 7, 2019

Embed
What would you like to do?
Block accessto WordPress directory and files
location = ~* /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
location = ~* /wp-config.php {
deny all;
log_not_found off;
}
location ~* /wp-includes/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
location ~* /wp-content/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
location ~* /(?:uploads|files)/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.