Created
March 7, 2019 21:10
-
-
Save olkitu/2af66d81dc9ac8d330d2ce52346bbab3 to your computer and use it in GitHub Desktop.
Block accessto WordPress directory and files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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