About Nginx reverse proxy

Xiaobai, I just came into contact with Nginx today. I heard that the reverse proxy of this server can optimize the access of the server, so Baidu learned this magical thing and had a little understanding.

Regarding the reverse proxy, let’s talk about the forward proxy first. The general forward proxy is to proxy the client. When our client accesses the server very slowly, or when it is directly blocked, such as Google’s This kind of website cannot be accessed normally in China. At this time, we will use scientific Internet access and use VPN to proxy our local ip address. The forward proxy is almost the meaning, the server does not know which ip address is actually being accessed, which optimizes the client's access.

If you understand this, the reverse proxy is easy to understand. The forward proxy proxy is the client, and the reverse proxy proxy is the server. Receive requests sent by our local client through a proxy server (let's call it that), and then the proxy server will perform an optimal allocation to access other servers. Of course, like the forward proxy, our local client does not know which client its request is sent to. For example, I live in Hunan and I want to buy a ThinkPad X1 carbon on Goudong. After I choose it, add it to the shopping cart and pay. The next day, the courier will deliver my dream computer to me, but Goudong There are factories all over the country. As a user, do you know where this computer was shipped from, Hubei? Zhejiang? Or Beijing? (Well, the express is actually written) But you don't need to pay attention to where it came from, you only pay attention to when I can get the computer as soon as possible. And Goudong will help you as an agent. It finds the nearest base and lets it receive your order, which is also the most efficient.

So when configuring Nginx, what we access is not the real IP address.

I understand so much about reverse proxy so far, and I don't know if it's right or not. There are still a lot of things to learn.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325317625&siteId=291194637