0

I need help with a strategy on how to think regarding IIS - URL rewrite - Application Request Routing.

Example

Let's say that I can access my web server from outside my wifi via http://2X0.2X1.2X2.2X3 (this is how it works today). My IIS webserver respond to a request with a web page (port 80). Fine, I understand how it works.

In a close future, I also need to to deal with external systems posting data to my node-red server instance. The node-red server instance resides on the same Windows 10 computer but it answers on another port (1880)

This is what I want to achieve:

If I make an external request to http://2X0.2X1.2X2.2X3/myHomePage/2/34/56, something (IIS?) should translate it to (inside my wifi) http://127.0.0.1:80/Index.aspx?value1=2&value2=34&value3=56

http://2X0.2X1.2X2.2X3/api/switch/turnOn/20, should translate to http://127.0.0.1:1880/switch/turnOn/20

http://2X0.2X1.2X2.2X3/api/switch/turnOff/20, should translate to http://127.0.0.1:1880/switch/turnOff/20

My question: I am pretty sure that IIS URL rewrite / Application Request Routing can help me here but I am not sure how to achieve it. How should the rules look like? Should I use URL rewrite?

Edit 1:

Im trying to depict my situation here: enter image description here

1

You can use IIS inbound rewrite rule. It will be something like this:

For myHomePage:

enter image description here

For api:

enter image description here

May be I lost the point somewhere, but I think logic is right.

p.s. Edited my answer.

3
  • Little mistake, {REQUEST_URI} shoud be will slash: /(.*) – warder Aug 3 '18 at 4:22
  • Just one more thing. How do I deal with the situation 2X0.2X1.2X2.2X3/myHomePage vs 2X0.2X1.2X2.2X3/api? They need to be redirected to different ports inside my wifi. – Hauns TM Aug 3 '18 at 5:20
  • I updated my question with an image @warder. – Hauns TM Aug 3 '18 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.