常规反代配置
location /
{
proxy_pass https://abc.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
而此时使用该配置反代Cloudflare全站加速下的HTTPS站点时,即反代服务器使用HTTPS 443端口访问Cloudflare,访问https://abc.com
会出现 502 Bad Request 报错,应添加两行proxy_ssl
设置,
proxy_ssl_name $host;
proxy_ssl_server_name on;
修改后的反代配置为
location /
{
proxy_pass https://abc.com;
proxy_ssl_name $host;
proxy_ssl_server_name on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
这样再次访问https://abc.com
就可以正常访问了。
Attention:
- 如果使用宝塔面板的反代,请注意
proxy_ssl
设置需要添加到每一种需要反代的文件类型的location /
下,否则会出现首页返回200成功状态码,但引用的js、css、图片的资源依然返回502 Bad Request状态码,从而导致页面显示不完全。- 如果反代站与源站域名不同可尝试将nginx配置中所有的
$host
修改为源站域名,如上述示例就可以修改为abc.com
文章来源于互联网:nginx反代Cloudflare加速下的HTTPS站点
all inclusive family vacations packages
https://red-viajes.com/11-cosas-culturales-que-hacer-en-goa-mas-alla-de-las-playas-y-bares/
cancun family resort
https://www.allaboutcuisines.com/cooking-school-classes/all/in/all
top all inclusive resorts in cancun mexico
https://www.rickshawchallenge.com/2016/03/04/cooking-classes-in-india-become-the-chef/
vacation packages to cancun all inclusive
https://www.allaboutcuisines.com/cooking-school-classes/all
best all inclusive resort cancun
all inclusive cancun vacations with air
top resorts in cancun mexico all inclusive
best all inclusive resorts in cancun with swim up rooms