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.
I'll explain it better:
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.
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.
Example of website's HTTP call:
$.get( "node.mymydomain.com/balance", function( data ) {
alert( data );
});
After 2 days fighting with IIS, ARR and URL rewrite I am not able to configure it properly and I believe it should not be so complicated.
This is what I have done so far:
- I created a server farm called "node" pointing to 127.0.0.1 and in advanced setting I changed the HTTP port from 80 to 3000 because that's where my node.js app is running:
- I am asked if I want to create a URL Rewrite Rule i click on Yes:
- I generate the following Condition:
- I add the condition and Route it to my new "node" server farm:
I tested on my laptop node.mydomain.com/balance and it is not working.
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