Azure website as caching reverse proxy using ARR

We are migrating one of our sites to Azure which was previously configured with ARR (Application Request Routing) as a caching reverse proxy. It has been configured as a reverse proxy that will respect the cache headers on the site it is proxying.

I followed this tutorial on using an Azure website as a reverse proxy and it all works great, except that it doesn't honor the site cache headers it proxies. I have tried adding some more appropriate elements to mine applicationHost.xdt

, but nothing that seems to me to have any effect.

Here's the relevant section from mine applicationHost.xdt

:

<system.webServer>
    <caching xdt:Transform="Replace" enabled="true" enableKernelCache="true" maxResponseSize="1000000"></caching>

    <proxy xdt:Transform="InsertIfMissing" enabled="true" reverseRewriteHostInResponseHeaders="true" minResponseBuffer="4096" responseBufferLimit="12392">
        <cache enabled="true" queryStringHandling="Accept" validationInterval="00:01:00" />
    </proxy>
</system.webServer>

      

and here's mine web.config

:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="CurrentTime" stopProcessing="true">
                <match url="^times/?(.*)" />
                <action type="Rewrite" url="http://example.com/{R:1}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

      

web.config

simply redirects all requests /times

to example.com

. This part works great. It just ignores the cache headers example.com

and doesn't cache anything, which is the main use case for why we want to set up a reverse proxy.

This same configuration works fine on a regular computer with IIS and ARR installed.

I would really like this work to work on azure sites without using the web role in the cloud service. I hope this is possible.

+3


source to share


1 answer


You tried to specify the preserveHostHeader = "true" flag like this:



 <proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="true" reverseRewriteHostInResponseHeaders="true" /> 

      

+1


source







All Articles