In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I usually use nginx for reverse proxy tomcat and other applications, but nginx also supports forward proxy
The so-called forward proxy means that intranet users access external resources through gateways, that is, when computers surf the Internet, the browser sets the http proxy address to access the Internet.
And reverse proxy means that external users access intranet resources through gateways. Generally speaking, your website runs on port 8080 of the intranet, and others can access it through port 80.
Http proxy configuration
# forward proxy server {listen 38080; # Resolution domain name resolver 8.8.8.8; location / {proxy_pass $scheme://$http_host$request_uri;}}
When the browser configures the proxy IP and port, and then accesses http://www.ip138.com, you can find that IP has changed, indicating that it has taken effect.
However, visiting the https website cannot be opened, because native nginx only supports http forward proxy. In order to support https forward proxy for nginx, you can patch ngx_http_proxy_connect_module + ssl module support.
Add https proxy module
Here you need to recompile nginx. You need to check the current nginx version and compilation options, and then go to the official website to download the same version of nginx source code for recompilation.
/ usr/local/nginx/sbin/nginx-Vwget http://nginx.org/download/nginx-1.15.12.tar.gztar-zxvf nginx-1.15.12.tar.gz
Download module ngx_http_proxy_connect_module
Git clone https://github.com/chobits/ngx_http_proxy_connect_module
Patch, modify the nginx source code, this step is very important, otherwise the later make will not pass.
Patch-d / root/nginx-1.15.12/-p 1 < / root/ngx_http_proxy_connect_module/patch/proxy_connect_rewrite
Add modules after the original configuration, and do not install after make
Cd / root/nginx-1.15.12/./configure-with-http_stub_status_module-with-http_ssl_module-with-file-aio-with-http_realip_module-add-module=/root/ngx_http_proxy_connect_module/makemv / usr/local/nginx/sbin/nginx / usr/local/nginx/sbin/nginx.bakcp / root/nginx-1.15.12/objs/nginx / usr/local/nginx/sbin/
Change the configuration file as follows, and then start the service
# forward proxy server {listen 38080; # resolution domain name resolver 8.8.8.8; # ngx_http_proxy_connect_module 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;}}
Summary
The agent doesn't feel very stable and sometimes can't open it, especially the https website. Don't do this when visiting foreign websites, just to familiarize yourself with the forward agent function of nginx.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.