In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The following brings you an overview of Nginx reverse proxy and detailed explanation of load balancing, hoping to bring some help to you in practical application. Load balancing involves more things, not many theories, and there are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.
1, what is a reverse proxy
1. As the name implies, an agent is to act for someone to do something, such as a lawyer's agent or an intermediary agent. Often what you can't do directly by yourself, you need to find an agent.
2. Why use reverse proxy
1. Before there is no proxy CVM, the user accesses the web server as shown below:
2. In the actual business generation environment, for example, when we visit the web server, there are often one or more proxy servers directly between the user and the server to forward your access request, visit the web server on your behalf, and then return the results to the user. When you only have one web server, this proxy doesn't seem to make much sense, isn't it faster for users to access the web server directly? But there is not only one web in production, it is very important to use proxy to forward and achieve load balancing at this time.
3. Reverse proxy load balancing
Protocols supported by Nginx Agent
Nginx reverse proxy support protocol
The reverse proxy model and the Nginx proxy module are summarized as shown in the table
4. Deploy Nginx reverse proxy load balancer
Environment:
Nginx-05: external network 10.0.0.5 intranet 172.16.1.5
Web-07: public network 10.0.0.7 private network 172.16.1.7 (deployment completed)
Web-08: public network 10.0.0.8 private network 172.16.1.8 (deployment completed)
1) nginx-05 installs nginx reverse proxy software
Yum provides nginx
Yum-y install nginx
2) define an agent module and create a new file
[root@172 nginx] # cat provxy_params
Proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_connect_timeout 30 *
Configure the virtual host and specify the web domain name, proxy module and address pool module in the virtual host
Cat / etc/nginx/conf.d/proxy_wordpress.conf
Upstream upload_pools {server 172.16.1.7server 8080; server 172.16.1.8virtual 8080;} server {listen 80; server_name blog.oldboy.com; location / {proxy_pass http://uploa_pools; include proxy_params;}}
When there are multiple domain name agents, just add an agent module and an address pool module (address pool name customization)!
3, test
1. The access domain name blog.oldboy.com can see the address from the nginx reverse proxy load balancer in the access logs of the two web systems.
After reading the above overview of Nginx reverse proxy and detailed explanation of load balancing, if you have anything else you need to know, you can find what you are interested in in the industry information or find our professional and technical engineer to answer, the technical engineer has more than ten years of experience in the industry.
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.