NGINX學習筆記——Choosing an Outgoing IP Address

來源:互聯網
上載者:User
原文地址:https://www.nginx.com/resources/admin-guide/reverse-proxy/
原文標題:Choosing an Outgoing IP Address

如果你的Proxy 伺服器有多個網路介面,有時候你可能會需要選擇特定的源IP地址串連被Proxy 伺服器或者上遊伺服器。如果NGINX後面的一個被Proxy 伺服器設定為只接受特定IP網路或者IP位址範圍的串連,這種配置就能派上用場了。
If your proxy server has several network interfaces, sometimes you might need to choose a particular source IP address for connecting to a proxied server or an upstream. This may be useful if a proxied server behind NGINX is configured to accept connections from particular IP networks or IP address ranges.

指定proxy_bind指令並設定網路介面的IP地址:
Specify the proxy_bind directive and the IP address of the necessary network interface:

location /app1/ {    proxy_bind 127.0.0.1;    proxy_pass http://example.com/app1/;}
location /app2/ {    proxy_bind 127.0.0.2;    proxy_pass http://example.com/app2/;}

IP地址也可以用變數指定。例如,$server_addr變數會傳遞接收到請求的網路介面的IP地址。
The IP address can be 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); }); });

    以上就介紹了NGINX學習筆記——Choosing an Outgoing IP Address,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.