加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

linux – nginx和cloudlfare ip混淆?

发布时间:2020-12-13 21:19:07 所属栏目:Nginx 来源:网络整理
导读:我在使用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_fr

我在使用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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读