{"id":1812,"date":"2018-07-26T16:18:41","date_gmt":"2018-07-26T08:18:41","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1812"},"modified":"2018-07-26T16:18:41","modified_gmt":"2018-07-26T08:18:41","slug":"%e7%bb%87%e6%a2%a6dedecms%e5%9c%a8%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bfnginx%e4%b8%8b%e8%ae%be%e7%bd%ae%e6%8c%87%e5%ae%9a%e7%9b%ae%e5%bd%95%e7%a6%81%e6%ad%a2%e8%bf%90%e8%a1%8cphp%e7%9a%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1812.html","title":{"rendered":"\u7ec7\u68a6DEDECMS\u5728\u5b9d\u5854\u9762\u677fNginx\u4e0b\u8bbe\u7f6e\u6307\u5b9a\u76ee\u5f55\u7981\u6b62\u8fd0\u884cPHP\u7684\u65b9\u6cd5"},"content":{"rendered":"

\u5728\u5b9d\u5854\u9762\u677f\u540e\u53f0-\u7f51\u7ad9\uff0c\u70b9\u51fb\u4f60\u9700\u8981\u8bbe\u7f6e\u7684\u7f51\u7ad9\u8bbe\u7f6e<\/p>\n

\"QQ\u622a\u56fe20180726155817\"<\/a><\/p>\n

\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u3002\u627e\u5230\u00a0#PHP-INFO-START\u00a0 PHP\u5f15\u7528\u914d\u7f6e\uff0c\u53ef\u4ee5\u6ce8\u91ca\u6216\u4fee\u6539\uff0c\u5728\u5b83\u4e0a\u9762\u6dfb\u52a0\uff1a<\/p>\n

location ~* \/(data|templets|uploads<\/span>)\/(.*).(php)$ {\r\n\treturn 403;\r\n}<\/code><\/pre>\n

\u5176\u4e2d\u7ea2\u8272\u6587\u5b57\u662f\u4f60\u9700\u8981\u7981\u6b62\u8fd0\u884cPHP\u7684\u6587\u4ef6\u5939\u540d\u79f0\uff0c\u4f60\u53ef\u81ea\u884c\u6dfb\u52a0\u6216\u8005\u5220\u9664\u3002<\/p>\n

\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\n
\"QQ\u622a\u56fe20180726155905\"<\/a><\/p>\n

\u4fdd\u5b58\u3002\u5728\u8f6f\u4ef6\u7ba1\u7406\u91cc\u9762\u91cd\u8d77Nginx\u670d\u52a1\u3002<\/p>\n

\u968f\u610f\u65b0\u5efa\u4e00\u4e2aPHP\u6587\u4ef6\uff0c\u6587\u4ef6\u5185\u5bb9\u968f\u610f\uff0c\u628a\u5b83\u4e0a\u4f20\u5230\u4f60\u7684\u9700\u8981\u7981\u6b62\u8fd0\u884cPHP\u7684\u76ee\u5f55\u91cc\u9762\u3002\u5982\u679c\u8bbf\u95ee\u6b63\u5e38\uff0c\u8bf4\u660e\u914d\u7f6e\u6ca1\u6709\u751f\u6548\u3002\u5982\u679c\u663e\u793a\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u8bf4\u660e\u914d\u7f6e\u6210\u529f\u3002<\/p>\n

\"QQ\u56fe\u724720180726160547\"<\/a><\/p>\n

 <\/p>\n

\u5982\u679c\u4f60\u7684php\u8fd0\u884c\u73af\u5883\u662fapache,\u53ef\u4f7f\u7528\u00a0.htaccess \u6587\u4ef6\u6765\u8bbe\u7f6e\uff0c<\/p>\n

RewriteEngine on\r\n#\u5b89\u5168\u8bbe\u7f6e \u7981\u6b62\u4ee5\u4e0b\u76ee\u5f55\u8fd0\u884c\u6307\u5b9aphp\u811a\u672c\r\nRewriteCond % !^$\r\nRewriteRule a\/(.*).(php)$ \u2013 [F]\r\nRewriteRule data\/(.*).(php)$ \u2013 [F]\r\nRewriteRule templets\/(.*).(php|htm)$ \u2013 [F]\r\nRewriteRule uploads\/(.*).(php)$ \u2013 [F]<\/code><\/pre>\n

\u7136\u540e\u628a.htaccess\u6587\u4ef6\u653e\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u3002\u91cd\u542fapache\u670d\u52a1\u3002<\/p>\n

\u4f7f\u7528windows\u670d\u52a1\u5668\u7684\uff0c\u7528 web.config \u6587\u4ef6\u6765\u8bbe\u7f6e\uff0c\u8bf7\u786e\u8ba4\u4f60\u7684\u4e3b\u673a\u5df2\u7ecf\u5f00\u542f\u4e86\u4f2a\u9759\u6001\u800c\u4e14\u7f51\u7ad9\u6839\u76ee\u5f55\u6709 web.config \u6587\u4ef6\uff0c\u6709\u8fd9\u4e2a\u6587\u4ef6\u7684\u53ef\u4ee5\u590d\u5236\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u5230\u5bf9\u5e94\u7684rules\u5185\u3002<\/p>\n

 <\/p>\n

<rule name=\"Block data\" stopProcessing=\"true\">\r\n\t<match url=\"^data\/(.*).php$\" \/>\r\n\t<conditions logicalGrouping=\"MatchAny\">\r\n\t\t<add input=\"{USER_AGENT}\" pattern=\"data\" \/>\r\n\t\t<add input=\"{REMOTE_ADDR}\" pattern=\"\" \/>\r\n\t<\/conditions>\r\n\t<action type=\"AbortRequest\" \/>\r\n<\/rule>\r\n<rule name=\"Block templets\" stopProcessing=\"true\">\r\n\t<match url=\"^templets\/(.*).php$\" \/>\r\n\t<conditions logicalGrouping=\"MatchAny\">\r\n\t\t<add input=\"{USER_AGENT}\" pattern=\"templets\" \/>\r\n\t\t<add input=\"{REMOTE_ADDR}\" pattern=\"\" \/>\r\n\t<\/conditions>\r\n\t<action type=\"AbortRequest\" \/>\r\n<\/rule>\r\n<rule name=\"Block SomeRobot\" stopProcessing=\"true\">\r\n\t<match url=\"^uploads\/(.*).php$\" \/>\r\n\t<conditions logicalGrouping=\"MatchAny\">\r\n\t\t<add input=\"{USER_AGENT}\" pattern=\"SomeRobot\" \/>\r\n\t\t<add input=\"{REMOTE_ADDR}\" pattern=\"\" \/>\r\n\t<\/conditions>\r\n\t<action type=\"AbortRequest\" \/>\r\n<\/rule><\/code><\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u5b9d\u5854\u9762\u677f\u540e\u53f0-\u7f51\u7ad9\uff0c\u70b9\u51fb\u4f60\u9700\u8981\u8bbe\u7f6e\u7684\u7f51\u7ad9\u8bbe\u7f6e \u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u3002\u627e\u5230\u00a0#PHP-INFO-START\u00a0 PHP\u5f15 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43,180],"class_list":["post-1812","post","type-post","status-publish","format-standard","hentry","category-web","tag-dedecms","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=1812"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1812\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}