Search code examples
routesiis-7.5arriis-arr

Application Request Routing doesn't route to same machine


I have setup an ARR in my IIS server. My requirement is I have to route a request to this ARR server to one of my application which is hosted in local IIS(ARR server itself). Is it possible?

ie. Suppose in my ARR server has Application1. Then I have to do the following

Broswer -> ARR (iis server) -> Application1(which is itself in ARR server).

If possible how can implement such a setup?


Solution

  • Yes you can.

    You need, at least, 2 sites to implement this. One will get the requests and route them to ARR via a Rewrite Rule, the other one will be the node behind ARR.

    For example, considering your domain name is "example.com":

    IIS
      - Site 1 (binding: http://example.com:80)
      - Site 2 (binding: http://127.0.0.1:22001)
    
    Rewrite Rule
      - Match All
        - {HTTP_HOST} matches example.com
        - {SERVER_PORT} does not match 22001
     - Action: Route to Farm
    

    This is a good starting point to do zero-downtime deployment. If you want to know more check this repo on GitHub: https://github.com/yosoyadri/IIS-ARR-Zero-Downtime