0
votes

Task:

I have a server with one subdomain. On this subdomain, I want to run multiple Angular instances on different paths. For example:

  • subdomain.bla.com/app1
  • subdomain.bla.com/app2

My attempt:

  1. I added one site in the IIS for subdomain.bla.com
  2. I installed the Application Request Routing Module in IIS
  3. I added a reverse proxy rule for /app1 to localhost:401 and /app2 to localhost:402
  4. I added one site for app1 and one for app2

Problem

On my local machine, this works fine but on the live server I always get a HTTP error 502.2 Bad Gateway - There was a connection error while trying to route the request. I already tried it with ARR 2.5 and ARR 3. The only difference between local and live I could find is the IIS version (10 local, 8.5 live) but I can't update it on live (Windows Server 2012 R2). FYI: There are no errors in the event log.

The rule

<rule name="ReverseProxyInboundRule1" stopProcessing="true">
    <match url="app1/(.*)" />
    <action type="Rewrite" url="http://localhost:401/{R:1}" />
</rule>

Thanks in regards

1
could you please provide your rule and the detailed error snapshot? did you try to run the site on a live server without IIS reverse proxy? make sure you enabled the arr on the live server. compare your both the server configuration. try to run failed request tracing to get more detail. docs.microsoft.com/en-us/iis/troubleshoot/… - Jalpa Panchal

1 Answers

1
votes

I found the answer by myself -> i forgot the "http://" in the rewrite rule"