Nginx is a lightweight web server developed by Russian programmer Igor sisov.
Compared with tomcat, nginx has excellent performance, can support 5W concurrent connections (while Tomcat can only support 200-400), and its CPU and memory consumption is very low, running very stable.
Nginx has many functions, but we usually use it as static resource server, load balancing server and reverse proxy server.
You can deploy static resources, HTML JS CSS image
load balancing（Load Balance）This means that a load is allocated to multiple operating units for execution
If the browser wants to access the server, it will first arrive at the load balancing server, which will distribute the traffic to different application servers through certain scheduling algorithm
First of all, let’s talk about the agent
Proxy: provides a proxy object for an object, and the proxy object controls the reference of the original object. In short, it provides an external proxy object for an object, which is called by others, and then the proxy object controls the execution of the proxy object.
Reverse proxyIt isYesServer sideActing as agent
As a client, we only need to send the request to the reverse proxy server, which selects the target server to obtain the data, and then responds to the client,
At this time, the reverse proxy server and the target server are external servers, exposing the proxy server address and hiding the real server IP address.
We’re done with reverse agent. By the way, forward agent
Forward agency: YesClientActing as agent
As a client, we want to access some servers, but the servers block our access. At this time, we need a proxy server, which can access the servers we want to access,We can give the client to this proxy server to help us access.