Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx reverse proxy configuration

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Reverse proxy: It refers to itself as a proxy server to accept requests on the Internet, then forward the request to the backend server and return the result to the client.

You can say that reverse proxy means that you call 10086, there is a proxy server in the middle, the proxy server assigns you to a customer service through some algorithm, and then you establish a link between you. If a customer service agent is talking to other customers when the traffic volume is large, multiple customer service agents are needed, which is called Load Balancer.

Nginx is a high-performance http and reverse proxy server that uses very little memory and is now used by many large companies.

Proxy Server: 192.168.7.80

Back-end servers: 192.168.7.90

Both servers have Nginx installed.

wget http://nginx.org/download/nginx-1.8.1.tar.gz \\Download nginxtar -zvxf nginx-1.8.1.tar.gz \\Decompress nginxgroupadd wwwuseradd www -s /sbin/nologin -g www \\Create user./ configure --user=www --group=www --prefix=/usr/local/nginx' \\compile nginx make &&make install \\install nginx/usr/local/nginx/sbin/nginx \\start nginx

access page

The requested URL/usr/local/nginx/conf/nginx.conf was not found on this server.

Add backend server 192.168.7.90 to proxy server

upstream test {server 192.168.7.90;} Add proxy_pass http://test;location / { proxy_pass http://test; root html; index index.html; }

Save exit and reload nginx

/usr/local/nginx/sbin/nginx -s reload

To make it easier to identify, let's change the content of 192.168.7.90

Visit 192.168.7.80 again

Did you find that the proxy was successful?

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: 222

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report