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

nginx 正向代理http和https

时间:2019-10-08 16:32:01

相关推荐

nginx 正向代理http和https

nginx正向代理默认只支持http,不支持https,需借助第三方模块“ngx_http_proxy_connect_module”来实现(/chobits/ngx_http_proxy_connect_module)

yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-develpatch -p1 </newData/soft/ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_1018.patch./configure --prefix=/usr/local/nginx2 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-threads --add-module=/newData/soft/ngx_http_proxy_connect_module-mastermake & make installnginx配置同时支持http和httpsserver {resolver 114.114.114.114 8.8.8.4 8.8.8.8; #多开几个,否则部分网站打不开listen 109;proxy_connect;proxy_connect_allow all;#支持不同端口httpsproxy_ignore_client_abort on;location / {fastcgi_param REQUEST_METHOD $request_method;fastcgi_param CONTENT_TYPE $content_type;fastcgi_param CONTENT_LENGTH $content_length;proxy_http_version 1.1;proxy_buffering off;proxy_set_header Cookie $http_cookie;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Scheme $scheme;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_ssl_server_name on; proxy_pass $scheme://$http_host$request_uri;proxy_set_header Host $http_host; #$http_host; #$host;proxy_set_header Content-Type $content_type;proxy_send_timeout 60000;proxy_read_timeout 60000;proxy_next_upstream error timeout invalid_header http_502;}}

如果碰到这种错误

make[1]: *** No rule to make target ‘objs/addon/ngx_http_mytest2/ngx_http_mytest2_module.o’, needed by ‘objs/nginx’. Stop.

1.确认上面安装的nginx模块是否都正确

2.ngx_http_proxy_connect_module-master 如果是从windows上拷过去,可能会有些文件不正确,需仔细确认

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