I am trying (and failing) to set up a reverse proxy.
I have tried:
RewriteEngine On
RewriteRule ^/ping/(.*) http://my.proxy.com/$1 [P,NC]
RewriteLog "managed-fusion-log.txt"
RewriteLogLevel 9
I believe this works because I see this in the log file:
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!!!
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!! :-)