IIS反向代理到node.js [英] IIS Reverse Proxy to node.js
问题描述
我正在尝试配置反向代理,以便从IIS中托管的网站向node.js应用程序发出HTTP调用。
I am trying to configure a reverse proxy so that HTTP calls made from a website hosted in the IIS to node.js applications work.
我将解释它更好:
我已经雇用了VPS。在这个VPS中我有一个IIS网站(简单的HTMl + Javascript)和一个在localhost:3000上运行的node.js应用程序。在javascript中,我对node.js进行HHTP GET调用以获取一些数据。
I've hired a VPS. In this VPS i have a IIS website (simple HTMl + Javascript ) and a node.js application running on localhost:3000. In javascript i make HHTP GET calls to the node.js to obtain some data.
我需要配置反向代理,以便对node.mydomain进行HTTP调用。例如,内部重定向到localhost:3000。
I need to configure a reverse proxy so that the HTTP calls made to node.mydomain.com for example, are internally redirected to localhost:3000.
网站HTTP呼叫示例:
Example of website's HTTP call:
$.get( "node.mymydomain.com/balance", function( data ) {
alert( data );
});
在与IIS,ARR和URL重写战斗2天后,我无法正确配置它,我相信它不是那么复杂......
After 2 days fighting with IIS, ARR and URL rewrite i am not able to configure it properly and i believe it is not so complicated...
这是我第一次使用IIS,我需要一些技巧或教程...
It's the first time i'm using IIS and i need some tips or tutorial...
这是我到目前为止所做的:
This is what i've done so far:
- 我创建了一个名为node的服务器场到127.0.0.1并在高级设置中我将HTTP端口从80更改为3000,因为这是我的node.js应用程序正在运行的地方:
- 我被问到是否要创建URL重写规则我点击是:
- 我生成了以下条件:
我添加条件并将其路由到我的新节点服务器场:
I add the condition and Route it to my new "node" server farm:
我在我的笔记本电脑node.mydomain.com/balance上进行测试并且它无法工作....:S
I test on my laptop node.mydomain.com/balance and it is not working.... :S
我真的很感激这方面的一些帮助。 。
I really would appreciate some help with this..
问候,
推荐答案
我终于成功解决了这个问题反向代理(IIS的ARR和URL重写),如以下指南中所述:
I finally managed to solve this using a reverse proxy (IIS's ARR and URL Rewrite) as it is explained in the following guide:
http://www.gitshah.com/2013/06/how-to-use-iis7 -as-front-end-to-java.html
这篇关于IIS反向代理到node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!