0

I am trying (and failing) to set up a reverse proxy.

I have tried:

2013-01-08T13:49:41 **********************************************
2013-01-08T13:49:41 [Rewrite] Input: http://swisscom-live.emusetech.com:81/ping/somecall.svc
2013-01-08T13:49:41 [Rule 0] Input: /ping/somecall.svc
2013-01-08T13:49:41 [Rule 0] Rule Pattern Matched
2013-01-08T13:49:41 [Rule 0] Output: http://my.proxy.com/somecall.svc
2013-01-08T13:49:41 [Rewrite] Proxy: http://my.proxy.com/somecall.svc
2013-01-08T13:49:41 **********************************************

However, the actual web browser shows me a 404 error from the "local" machine. The logs say it's doing the right thing, but I can't figure out why it's not actually doing it!


Pointers appreciated! (On Managed Fusion or either of the other items).


UPDATE: I finally managed to get the Microsoft-specific way working. The trick (that I was missing) is that I needed to create a separate, empty Web Application and only create the reverse proxy on this new application.

I suspect that the other applications I was trying to add this to had some over-riding configurations which stopped URL-rewriting from working (but still allowed redirection).

Still interested in any comments on the Managed Fusion issue, though!!!

Peter K.
  • 8,028
  • 4
  • 48
  • 73

2 Answers2

1

Had the same issue (404) when using managed fusion as proxy.

Apparently there is a handler to register in addition to the module that is not added automatically with the nuget package installation.

Web.config:

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="RewriterModule" type="ManagedFusion.Rewriter.RewriterModule, ManagedFusion.Rewriter" preCondition="" />
    </modules>
    <handlers>
      <add name="RewriterProxyHandler" preCondition="integratedMode" verb="*" path="RewriterProxy.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
</system.webServer>
Jonas
  • 665
  • 7
  • 14
0

When I moved the above solution to the production machines, it failed to work for URLs containing .svc. It turned out that [this answer][5] to another question had the solution.

This ended up adding this to the web.config of the reverse proxy:

<system.web>
 <compilation targetFramework="4.0">
  <buildProviders>
   <remove extension=".svc" />            
  </buildProviders>
 </compilation>
</system.web>

so that service calls to the remote server were actually made, rather than interpreted locally.

And this had the upshot of also resolving the issue with Managed Fusion!! :-)

Peter K.
  • 8,028
  • 4
  • 48
  • 73