{"id":2579,"date":"2019-03-30T12:10:09","date_gmt":"2019-03-30T04:10:09","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=2579"},"modified":"2019-03-30T12:10:09","modified_gmt":"2019-03-30T04:10:09","slug":"nginx%e7%a6%81%e6%ad%a2%e5%9e%83%e5%9c%be%e8%9c%98%e8%9b%9b%e8%ae%bf%e9%97%ae","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/2579.html","title":{"rendered":"nginx\u7981\u6b62\u5783\u573e\u8718\u86db\u8bbf\u95ee"},"content":{"rendered":"

nginx\u7981\u6b62\u5783\u573e\u8718\u86db\u8bbf\u95ee\uff0c\u628a\u4e0b\u5217\u4ee3\u7801\u653e\u5230\u4f60\u7684nginx\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u3002<\/p>\n

#\u7981\u6b62Scrapy\u7b49\u5de5\u5177\u7684\u6293\u53d6\r\nif ($http_user_agent ~* (Scrapy|Curl|HttpClient)) {\r\n     return 403;\r\n}\r\n#\u7981\u6b62\u6307\u5b9aUA\u53caUA\u4e3a\u7a7a\u7684\u8bbf\u95ee\r\nif ($http_user_agent ~ \"opensiteexplorer|MauiBot|FeedDemon|SemrushBot|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|semrushbot|alphaseobot|semrush|Feedly|UniversalFeedParser|webmeup-crawler|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|^$\" ) {\r\n     return 403;             \r\n}\r\n#\u7981\u6b62\u975eGET|HEAD|POST\u65b9\u5f0f\u7684\u6293\u53d6\r\nif ($request_method !~ ^(GET|HEAD|POST)$) {\r\n    return 403;\r\n}<\/code><\/pre>\n

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

nginx\u7981\u6b62\u5783\u573e\u8718\u86db\u8bbf\u95ee\uff0c\u628a\u4e0b\u5217\u4ee3\u7801\u653e\u5230\u4f60\u7684nginx\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u3002 #\u7981\u6b62Scrapy\u7b49\u5de5\u5177\u7684\u6293\u53d6 if […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[850,851,852],"class_list":["post-2579","post","type-post","status-publish","format-standard","hentry","category-wljs","tag-nginx","tag-851","tag-852"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/2579","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=2579"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/2579\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=2579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=2579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=2579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}