100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > nginx正向代理https

nginx正向代理https

时间:2020-11-03 20:57:19

相关推荐

nginx正向代理https

nginx正向代理https

需求

当出现下述情形时,我们需要使用正向代理:

我们的client不能直接访问到服务器,倒是其他的client可以访问,且我们的client到OtherClient

的网络是通的。

如何搭建正向代理

使用nginx

使用squid

。。。其他的方式

本人搭建的方式为nginx

使用nginx搭建正向代理

材料

nginx源码(1.14.2)

nginx支持CONNECT的patch : git clone /chobits/ngx_http_proxy_connect_module.git

nginx的各个依赖—上中找寻nginx的依赖相关的问题

编译过程

cd /path/to/nginx

patch -p1 < /path/to/ngx_http_proxy_connect_module/patch/proxy_connect_rewrite_1014.patch

./configure --add-module=/path/to/ngx_http_proxy_connect_module

make & make install : 默认会安装到/usr/local/nginx目录

修改配置

#resolver 119.29.29.29;resolver 8.8.8.8;server {listen 6666;proxy_connect;proxy_connect_allow443 563;proxy_connect_connect_timeout 10s;proxy_connect_read_timeout 10s;proxy_connect_send_timeout 10s;location / {proxy_pass http://$host;proxy_set_header Host $host;}}

启动nginx

sbin/nginx -c conf/nginx.conf

client链接otherClient(chrome)

使用Proxy SwitchySharp,设置Manual Configuration

http proxy = otherClient ip

Port = 6666

勾上Use the same proxy server for all protocols

使用该配置

之后在chrome中的所有请求都经过该代理去访问服务

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。