One of the frequent uses of nginx is setting it up as a proxy server, which means a server that receives requests, passes them to the proxied servers, retrieves responses from them, and sends them to the clients.

 The proxy_pass directive is what makes this configuration a reverse proxy. 

 

访问后端池的协议是http

 

nginx - reverse proxy 反向代理_后端服务

 

 

nginx - reverse proxy 反向代理_后端服务_02

 

 

后端池可以配置不同的port:

访问这个proxy的port 80端口后,流量会被送到后端服务器10.0.0.5的port 8080,或者送到10.0.0.6的port 80

 

 

nginx - reverse proxy 反向代理_80端口_03