Home >Operation and Maintenance >Nginx >What to do with nginx reverse proxy
nginx consists of the following parts
The proxy_pass directive can proxy to the URL address after proxy_pass according to the rules
server_name is used to define which URLs use this rule
Proxy all requests under gulimaill.com
The load balancing syntax is as follows upstream is defined to use the load balancing server in the balancing server proxy_pass
You can use this method to proxy the gateway
http { upstream myapp1 { server srv1.example.com; server srv2.example.com; server srv3.example.com; } server { listen 80; location / { proxy_pass http://myapp1; } }
upstream gulimall { server 192.168.1.7:10001; } location / { proxy_set_header Host $host; # proxy_pass http://192.168.1.7:10000; proxy_pass http://gulimall; }
Then configure the gateway
When the url is ***.gulimaill If .com, jump to the product service
The above is the detailed content of What to do with nginx reverse proxy. For more information, please follow other related articles on the PHP Chinese website!