Nginx 使用CloudFlare CDN加速配置

本文详细介绍了如何将Nginx服务器与CloudFlare CDN结合使用,以实现网站内容的快速分发和加速。通过配置Nginx的反向代理和缓存设置,以及在CloudFlare上进行相应的DNS解析和SSL证书配置,可以显著提升网站的加载速度和用户体验。
摘要由CSDN通过智能技术生成

- -

#CloudFlare real ip
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   104.16.0.0/12
set_real_ip_from   172.64.0.0/13
ipv6:
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;

#Proxy Configuration
proxy_set_header Host $proxy_host;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header referer http://$proxy_host$request_uri;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_set_header Cf-Ray "";
proxy_set_header X-Forwarded-Proto "";
proxy_set_header CF-Visitor "";
proxy_set_header CF-Connection-IP "";


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值