Nginx Learning Note--choosing an outgoing IP Address

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.