Alanku 大佬有话说 : 半小时前
DigitalOcean的在线Nginx配置生成工具
本帖最后由 Alanku 于 2020-10-2 11:32 编辑
DigitalOcean的在线Nginx配置文件生成工具还挺好用,就是选Wordpress时会有一份针对wordpress的特别规则,具体如下。
这份规则屏蔽了好多东西,包括后台管理的样式和脚本文件,这样的话,进入wordpress后台管理就基本无法操作了,样式没有,点击也没反应。
这么设置是为了安全考虑吗?是的话,我们怎么管理wordpress后台啊?不要这份规则影响大不大?
# WordPress: allow TinyMCE
location = /wp-includes/js/tinymce/wp-tinymce.php {
include nginxconfig.io/php_fastcgi.conf;
}
# WordPress: deny wp-content, wp-includes php files
location ~* ^/(?:wp-content|wp-includes)/.*.php$ {
deny all;
}
# WordPress: deny wp-content/uploads nasty stuff
location ~* ^/wp-content/uploads/.*.(?:s?html?|php|js|swf)$ {
deny all;
}
# WordPress: SEO plugin
location ~* ^/wp-content/plugins/wordpress-seo(?:-premium)?/css/main-sitemap.xsl$ {}
# WordPress: deny wp-content/plugins (except earlier rules)
location ~ ^/wp-content/plugins {
deny all;
}
# WordPress: deny scripts and styles concat
location ~* /wp-admin/load-(?:scripts|styles).php {
deny all;
}
# WordPress: deny general stuff
location ~* ^/(?:xmlrpc.php|wp-links-opml.php|wp-config.php|wp-config-sample.php|wp-comments-post.php|readme.html|license.txt)$ {
deny all;
}
Stevenchu 大佬有话说 : 23 分钟前
这么设置是为了安全考虑吗?
是
是的话,我们怎么管理wordpress后台啊?
谷歌解决办法(通常修改下WP-Config文件)继续管理
不要这份规则影响大不大?
按网页意思, 这是建议配置。 不喜欢的话运行正常PHP配置也能用。
第六条是为什么你后台打不开原因, wp-config.php 加个这个
https://gist.github.com/moneal/9859180 这里面代码发不上来
这个…