Nginx正向代理默认不支持https
可通过安装第三方模块支持https,github资源
https://github.com/chobits/ngx_http_proxy_connect_module
安装后配置:
nginx.conf
server {
resolver 114.114.114.114;
proxy_connect;
proxy_connect_allow 443 563;
proxy_connect_connect_timeout 10s;
proxy_connect_read_timeout 10s;
proxy_connect_send_timeout 10s;
location / {
proxy_pass $scheme://$http_host$request_uri;
proxy_set_header Host $host;
}
}
该博客介绍了如何解决Nginx默认不支持HTTPS的問題,通过安装ngx_http_proxy_connect_module第三方模块来实现。详细配置步骤包括设置resolver、启用proxy_connect模块及相关超时设置,并在location块中配置proxy_pass以实现HTTPS连接。此方法适用于需要在Nginx中进行HTTPS代理的场景。

1万+

被折叠的 条评论
为什么被折叠?



