软件在常规安装nginx基本上,需要增加一个proxy_connect_connect

wget https://github.com/chobits/ngx_http_proxy_connect_module/archive/master.zip -O ngx_http_proxy_connect_module.zip
unzip ngx_http_proxy_connect_module.zip
#https://github.com/chobits/ngx_http_proxy_connect_module 版本对应
#当前nginx 1.15.5
patch -p1 < /tmp/ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_101504.patch
#如果已经有nginx 可用nginx -V看看之前的安装模板避免丢失


./configure --prefix=/usr/local/nginx \
--user=www \
--group=www \
--with-mail \
--with-mail_ssl_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_dav_module \
--with-http_sub_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-pcre \
--add-module=/tmp/ngx_http_proxy_connect_module-master/

make

make install

以下配置,代理http和https上网请求

resolver 192.168.0.1;
server {
        listen 8088;
        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;
        }
}

123.jpg