微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

linux – nginx和cloudlfare ip混淆?

我在使用Cloudflare加速服务时使用我的Nginx.conf的http块中的以下配置来获取真正的ip:

    ## Cloudflare settings to get Real IP's
    set_real_ip_from   204.93.240.0/24;
    set_real_ip_from   204.93.177.0/24;
    set_real_ip_from   199.27.128.0/21;
    set_real_ip_from   173.245.48.0/20;
    set_real_ip_from   103.21.244.0/22;
    set_real_ip_from   103.22.200.0/22;
    set_real_ip_from   103.31.4.0/22;
    set_real_ip_from   141.101.64.0/18;
    set_real_ip_from   108.162.192.0/18;
    set_real_ip_from   190.93.240.0/20;
    set_real_ip_from   188.114.96.0/20;   
    set_real_ip_from   197.234.240.0/22;
    set_real_ip_from   198.41.128.0/17;
    set_real_ip_from   162.158.0.0/15;
    set_real_ip_from   2400:cb00::/32;
    set_real_ip_from   2606:4700::/32;
    set_real_ip_from   2803:f800::/32;
    set_real_ip_from   2405:b500::/32;
    set_real_ip_from   2405:8100::/32;
    real_ip_header     CF-Connecting-IP;

我也使用上面配置下面定义的Nginx速率限制功能

limit_conn_zone $binary_remote_addr zone=two:30m; 

这是由limit_conn强制执行的16; PHP位置块中的指令在/ etc / Nginx / sites-enabled的’default’文件中.

我的问题是,这是正确的,它不会限制和阻止Cloudflare IP?

根据我自己的经验(我也使用Nginx和CloudFlare)和documentation的引用我可以说它确实是正确的,CloudFlare IP不会被限制或阻止.

The ngx_http_realip_module module is used to change the client address

原文地址:https://www.jb51.cc/nginx/435456.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐