Original address: https://www.nginx.com/resources/admin-guide/reverse-proxy/
Original title: Choosing an outgoing IP Address
If your proxy server has multiple network interfaces, sometimes you may need to select a specific source IP address to connect to the proxy server or the upstream server. This configuration can be useful if a proxy server behind Nginx is set to accept connections only for a specific IP network or IP address range.
If your proxy server has several network interfaces, sometimes the might need to choose a particular source IP address for Connecting to a proxied server or an upstream. This could be useful if a proxied server behind NGINX are configured to accept connections from particular IP networks or IP Address ranges.
Specify proxy_bind the directive and set the IP address of the network interface:
Specify the proxy_bind directive and the IP address of the necessary network interface:
/app1/ { 127.0.0.1; http://example.com/app1/;}
/app2/ { 127.0.0.2; http://example.com/app2/;}
The IP address can also be specified with a variable. For example, a $server_addr variable passes the IP address of the network interface that receives the request.
The IP address can also specified with a variable. For example, the $server _addr variable passes the IP address of the network interface that accepted the request:
location /app3/ { proxy_bind$server_addr; proxy_pass http://example.com/app3/;}
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Nginx learning note--choosing An outgoing IP address, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.