IIS 下 部署nodejs 使用反向 Proxy

來源:互聯網
上載者:User

標籤:customer   default   伺服器   log   server   article   get   nodejs   alt   

目標伺服器:targetServer

配置反向 Proxy的伺服器:reveseProxServer

iis應該是iis7及以上版本,才可以。

1、確定最終訪問的網址:比如www.baidu.com  、www.jb51.net等等。

    當然你也可以自己在targetServer部署自己的程式,在此為了示範,我在targetServer上部署了2個,用的8088連接埠,程式分別是:

    http://targetServer:8088/Auditsys/Default.htm

    http://targetServer:8088/GCustomer/Login.htm

   

         

2、下面的操作均在在reveseProxServer上執行。

3、安裝IIS。

4、安裝ARR,(http://www.iis.net/downloads/microsoft/application-request-routing)

5、建立一個網站:(我的樣本YIWeb,連接埠是8080)   http://reveseProxServer:8080

    

5、啟用Proxy

 

    

6、添加URL重寫規則

   

 

然後添加一個空白規則:

儲存這個規則,ok了!

7、試試效果

 

8、總結:

    上面的 ^(.*) 、 ^192.168.3.73:8080$ 、http://targetserver:8088/{R:1}

    表示:用192.168.3.73:8080替換http://targetserver:8088/,

            {R:1}就表示^(.*),意思是“http://targetserver:8088/”後面匹配任何字元

            eg:訪問192.168.3.73:8080/test/index.htm

                這個url就被重寫成了http://targetserver:8088/test/index.htm

IIS 下 部署nodejs 使用反向 Proxy

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.