惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

九月的风

OneXPlayer 飞行家F1Pro「新玩具」 - 九月的风 终不似,少年游「摩旅中国」 - 九月的风 SSHPASS 免交互 SCP 传输文件「备份」 - 九月的风 docker hub 自建镜像加速「可用」 - 九月的风 海尔随身WIFI MF761W 焊接SIM卡槽「打火机工艺」 - 九月的风 海尔随身WIFI F231ZC/M23L/761W 刷机去控教程 - 九月的风 「自作」Chrome_123.0.6312.123_64bit_Portable - 九月的风 Chrome 浏览器关闭左上角搜索标签页的解决办法 - 九月的风 「摘抄」Wordpress 网站性能优化指南(免插件) - 九月的风
「备份」Nginx 反代 Cloudflare 站点 - 九月的风
September · 2024-06-01 · via 九月的风

Nginx 在反代套用了 Cloudflare CDN 的网站时,会出现 502 错误。修复这一个错误只需要在 Nginx 反代配置中修改操作。

代码如下:

location /
{
proxy_pass https://xxx;
proxy_set_header Host xxx;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_ssl_name $http_host;
proxy_ssl_server_name on;
proxy_ssl_protocols TLSv1.2 TLSv1.3;
add_header X-Cache $upstream_cache_status;

#Set Nginx Cache

add_header Cache-Control no-cache;
}

#PROXY-END/

重要设置:
//Nginx SNI
proxy_ssl_name $http_host;
proxy_ssl_server_name on;
//指定 SSL 协议
proxy_ssl_protocols TLSv1.2 TLSv1.3;

互联网上的大部分教程只提了 SNI,自己测试之后还是反复 502,直到设置了指定 SSL 协议之后,成功反代 Cloudflare CDN 站点!

搜索了很多相关的教程资料,有很大一部分超过 99% 的教程都没有提及要指定 SSL 协议,走了不少弯路,特此记录一下备忘!