{"id":134592,"date":"2020-07-07T22:58:41","date_gmt":"2020-07-07T14:58:41","guid":{"rendered":"http:\/\/4563.org\/?p=134592"},"modified":"2020-07-07T22:58:41","modified_gmt":"2020-07-07T14:58:41","slug":"%e5%85%b3%e4%ba%8e-nginx-%e8%ae%be%e7%bd%ae%e6%8b%92%e7%bb%9d%e6%88%96%e5%85%81%e8%ae%b8%e6%8c%87%e5%ae%9a-ip-%e8%ae%bf%e9%97%ae%e7%9a%84%e9%85%8d%e7%bd%ae%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=134592","title":{"rendered":"\u5173\u4e8e Nginx \u8bbe\u7f6e\u62d2\u7edd\u6216\u5141\u8bb8\u6307\u5b9a ip \u8bbf\u95ee\u7684\u914d\u7f6e\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e Nginx \u8bbe\u7f6e\u62d2\u7edd\u6216\u5141\u8bb8\u6307\u5b9a ip \u8bbf\u95ee\u7684\u914d\u7f6e\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bavtoex <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u670d\u52a1\u5668\u662f nginx \u505a web \u670d\u52a1\u7684,\u6709\u6ca1\u6709\u5168\u5c40\u7684\u914d\u7f6e\u4e00\u6b21,\u5c31\u53ef\u4ee5\u62d2\u7edd\u4e00\u6279 ip \u548c\u6307\u5b9a ua \u7684\u529e\u6cd5?<\/p>\n<p>\u8981\u5168\u5c40\u662f\u56e0\u4e3a\u6709\u5f88\u591a\u4e2a\u7f51\u7ad9,\u5982\u679c\u5728\u6bcf\u4e2a\u7f51\u7ad9\u7684 server \u5757\u4e0b\u5f15\u5165\u62d2\u7edd ip \u7684\u914d\u7f6e\u6587\u4ef6,\u90a3\u4f1a\u4e0d\u4f1a\u635f\u5931\u6027\u80fd?\u56e0\u4e3a\u5355 ip \u914d\u7f6e\u6587\u4ef6\u90fd 2m \u4e86.<\/p>\n<p>\u56e0\u4e3a\u6211\u5728\u53e6\u4e00\u670d\u52a1\u5668\u4e0a\u7528 apache \u53ef\u4ee5\u5728\u4e3b\u914d\u7f6e\u6587\u4ef6\u52a0\u4e00\u6b21\u62d2\u7edd ip \u7684\u914d\u7f6e,\u76ee\u5f55\u4e0b\u6240\u6709\u7f51\u7ad9\u90fd\u53ef\u4ee5\u751f\u6548.\u60f3\u95ee\u95ee nginx \u6709\u6ca1\u6709\u540c\u6837\u7684\u65b9\u6cd5.\u6216\u8005\u53ef\u4ee5\u5728 centos \u9632\u706b\u5899\u4e0a\u53ef\u4ee5\u8bbe\u7f6e?<\/p>\n<p>apache \u914d\u7f6e:<\/p>\n<p> &lt;Directory &#8220;\/www\/wwwroot\/&#8221;&gt;<\/p>\n<p>SetEnvIfNoCase User-Agent &#8220;SemrushBot&#8221; badbots<\/p>\n<p> Order deny,allow <\/p>\n<p>deny from env=badbots<\/p>\n<p>deny from 1.1.1.0\/23<\/p>\n<p>&#8230;      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2493930\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ik <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             deny 1.1.1.0\/23;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493931\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bavtoex <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ik \u975e\u5e38\u611f\u8c22,\u53ef\u4ee5\u4e86,\u53ea\u662f\u4e0d\u80fd\u8bbe\u7f6e User-Agent \u8bbf\u95ee\u4e86,\u624b\u52a8\u5728\u6bcf\u4e2a sever \u914d\u7f6e User-Agent \u89c4\u5219\u5c31\u6ca1\u6709\u6bcf\u4e2a\u8bbe\u7f6e ip \u89c4\u5219\u90a3\u4e48\u9ebb\u70e6\u4e86.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493932\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nieqibest <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u5565\u4e0d\u7528 iptables                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493933\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Nangle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Nginx+lua<br \/>https:\/\/github.com\/XOS\/ngx_lua_waf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493934\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bavtoex <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nieqibest \u7f51\u7ad9\u5957\u4e86 cf iptables \u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6ca1\u6709\u7528\u4e86,nginx \u6709\u8bbe\u7f6e real_ip_header CF-Connecting-IP;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493935\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chinvo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @bavtoex #5 real ip \u53ea\u5bf9 Nginx \u81ea\u8eab\u6709\u6548                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493936\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhouzm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f7f\u7528 openresty \u4ee3\u66ff nginx\uff0clua \u811a\u672c\u8bbf\u95ee redis \u6216 mysql \u96c6\u4e2d\u63a7\u5236                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2493937\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Randall <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f53\u7136\u53ef\u4ee5\uff0c\u7136\u800c\u4e0d\u5efa\u8bae\u8fd9\u4e48\u505a\uff0c\u4e1a\u52a1\u7cfb\u7edf\u7684\u4e8b\u60c5\uff0c\u4e0d\u8981\u653e\u5728 iptables \u6216 nginx \u5c42\u9762\u6765\u89e3\u51b3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e Nginx \u8bbe\u7f6e\u62d2\u7edd\u6216\u5141\u8bb8\u6307&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134592"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134592"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134592\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134592"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}