Skip to content

Instantly share code, notes, and snippets.

@jooray
Created January 23, 2019 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jooray/dd15e3dd442d76d0307ffe20c6ec2089 to your computer and use it in GitHub Desktop.
Save jooray/dd15e3dd442d76d0307ffe20c6ec2089 to your computer and use it in GitHub Desktop.
Securing wordpress in nginx
location ~ ^/wp-admin/includes/ {
return 403;
}
location ~ ^/wp-includes/[^/]+\.php$ {
return 403;
}
location ~ ^/wp-includes/js/tinymce/langs/.+\.php {
return 403;
}
location ~ ^/wp-includes/theme-compat/ {
return 403;
}
location = /xmlrpc.php {
return 403;
}
location ~ (repair|wp-mail)\.php {
return 403;
}
location ~ \.(log|txt)$ {
return 403;
}
location ~ (^\.|wp-config(-sample)*\.php) {
return 403;
}
location ~ (liesmich.html|readme.html|(.*)\.ttf|(.*)\.bak) {
return 403;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment