JediNitrate
JediNitrate

Reputation: 13

ARR (Load Balancing Mode) only shows 404

Preamble:

I have 3 windows 2016 vms with IIS

  1. IIS04 - the ARR server (arr.mytestapp.com)
  2. IIS10 - the 1st load balancing target (host1.mytestapp.internal)
  3. IIS11 - the 2nd load balancing target (host2.mytestapp.internal)

From the ARR server, i can browse to both hosts (the app loads)

For the farm setup, i have added both servers and this URL test

http://arr.mytestapp.com/status.aspx
Response Match = [Online]

which tests successfully - both servers pass

The Issue

When i browse to the arr url, it gives me "HTTP Error 404. The requested resource is not found"

I've enabled failed request tracing rules, but cant see much in there that's obviously wrong. The rewrite rules are using the name of the farm... not sure if this is a problem

 <EventData>
  <Data Name="ContextId">{80000015-0001-FF00-B63F-84710C7967BB}</Data>
  <Data Name="Substitution">http://mytestapp.website/{R:0}</Data>
  <Data Name="RewriteURL">http://mytestapp.website/favicon.ico</Data>
  <Data Name="AppendQueryString">true</Data>
  <Data Name="LogRewrittenURL">false</Data>
 </EventData>
     
<EventData>
    <Data Name="ContextId">{80000015-0001-FF00-B63F-84710C7967BB}</Data>
    <Data Name="OldUrl">http://mytestapp.website/favicon.ico</Data>
    <Data Name="NewUrl">/favicon.ico</Data>
</EventData>

I'm guessing this has something to do with my URL Rewrite rule... but I'm stumped.

<rule name="ARR_mytestapp.website" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
    <action type="Rewrite" url="http://mytestapp.website/{R:0}" />
    <conditions>
       <add input="{HTTP_HOST}" pattern="*.mytestapp.com" />
       <add input="{HTTP_HOST}" pattern="api.mytestapp.com" negate="true" />
    </conditions>
</rule>

Any help would be greatly appreciated

Upvotes: 1

Views: 537

Answers (1)

JediNitrate
JediNitrate

Reputation: 13

So, if you have multiple sites setup on the same server, you need to add the ARR servers host header into each web servers host headers. It appears that ARR preserves the host header of the original request.

so for my setup, I now have the following. This resolves the 404 error

Site Bindings ARR Server

  • arr.mytestapp.com

Web Host 1

  • host1.mytestapp.internal
  • arr.mytestapp.com

Web Host 2

  • host2.mytestapp.internal
  • arr.mytestapp.com

Upvotes: 0

Related Questions