Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does a reverse proxy rewrite rule stop working when System.Web.Routing is active?
    primarykey
    data
    text
    <p>Boiling this down to the simplest possible rule:</p> <pre><code> &lt;rule name="Reverse Proxy" stopProcessing="true"&gt; &lt;match url="^external/(.*)" /&gt; &lt;action type="Rewrite" url="http://some-site/{R:1}" /&gt; &lt;/rule&gt; </code></pre> <p>("Enable Proxy" is checked in the ARR Server Proxy settings at the server level).</p> <p>The above rewrite rule works fine in a very simple test app with a web.config containing the section, it works fine in a web forms app, but if I put the same rule into an MVC3 app (on the same machine, so identical config for IIS higher up) it never has any effect; the request flows through.</p> <p>if it's just a rewrite (and not a reverse proxy) it works OK, e.g.,</p> <pre><code> &lt;rule name="rewrite to internal" stopProcessing="true"&gt; &lt;match url="^internal/(.*)" /&gt; &lt;action type="Rewrite" url="different-internal/{R:1}" /&gt; &lt;/rule&gt; </code></pre> <p>...is fine.</p> <p>I can get the reverse proxy rule to work if I add </p> <pre><code> routes.IgnoreRoute("external/{*pathInfo}"); </code></pre> <p>in the Global.asax.cs class, so that my request for external/* doesn't hit the default controller, but I don't understand why. I think the URL rewrite module kicks in way before the Routing (see <a href="http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/" rel="nofollow">http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/</a>) so I'd expect there not to be a conflict between them.</p> <p>Is the Routing module adding in "virtual" rewrite rules to the URL rewrite module, that are overriding my declared rewrite rules?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload