We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Reverse proxy on svc

Hi
I am trying to setup a Reverse Proxy for a WCF web service, in this case a QuoteConnector.
I use the procedure described here.
But, no matter what I do, when I enter https://crm.customer.com/IntegrationServer/QuoteConnector.svc in the browsers address, I get references to local addresses like http://crmsrv01.customer.local/IntegrationServer/QuoteConnector.svc?wsdl in the response. According to the outbound rule IIS should rewrite internal URLs to external ones.
Here is the web.config of my proxy site:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="https://crm.customer.com(.*)" />
                    </conditions>
                    <action type="Rewrite" url="http://crmsrv01.customer.local/{R:1}" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="Rewrite Location" enabled="true" stopProcessing="true">
                    <match serverVariable="RESPONSE_LOCATION" pattern="http://crmsrv01.customer.local(.*)" />
                    <action type="Rewrite" value="https://crm.customer.com{R:1}" />
                </rule>
            </outboundRules>
        </rewrite>
    </system.webServer>
    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.web>
        <customErrors mode="Off" />
    </system.web>
</configuration>

It seems as if the outbound rule is completely ignored.
Please help!

Best regards, Marc

RE: Reverse proxy on svc

In the meantime I found out that the reverse proxy works fine, with the above settings. To confirm, I deployed a simple test WCF service to the customers web server, and called it from here. The service worked fine, so the requests and responses made their way through the reverse proxy, as expected.

The problem is that WCF apparently composes meta data in the local context of the web server, and publishes meta data without taking care of URL translation / rewriting. Nevertheless, the web service itself works fine.

Av: Marc Eberhard 19. jul 2019