Search code examples
.neturliisurl-rewritingarr

IIS ARR reverse proxy only works for existing resource URLs


I have URL Rewrite & ARR installed in my IIS: IIS machine dashboard

And ARR proxy enabled: Server proxy setting

I have a .net app in my IIS. a local .net app site

There are 2 files in it. WebForm1.aspx and WebForm2.aspx .net project

And if I set up URL Rewrite from webform1.aspx to an external website, it works URL Rewrite rule browser log

But if I set it up with webform3.aspx, it shows 404. It's like the rule doesn't take effect for non-existing page. error page


Solution

  • If we enable failed request tracing then we will notice that the rewrite rule has succeeded.

    enter image description here

    Then problem is asp.net pipeline brake it.

    enter image description here

    If you try it on an empty website, it will work.

    enter image description here

    So you'd better be careful when you reverse proxy to an external website.