Question

Publish to CloudFormation from Visual Studio is great, it gives you the possibility of deploying your web site to a single server or a Load balanced stack.

The problem rises when you want to deploy more than 1 web site in a single server, because in each deployment the main web.config located in c:\inetpub\wwwroot gets modified adding UrlRewrite. This redirects all requests from previous deployed web site to the new one. I.e. / --/FIRST --/SECOND

If I ask for a page on First it's searched in /Second/First.

The changes applied are as follows:

    <rewrite>
        <rules>
            <rule name="AWS_DEPLOYMENT" stopProcessing="false">
                <match url="^(https?://[^/]+/)SECOND" ignoreCase="true" negate="true" />
                <conditions>
                    <add input="{PATH_INFO}" pattern="^/SECOND" negate="true" />
                </conditions>
                <action type="Rewrite" url="{R:1}SECOND{PATH_INFO}" logRewrittenUrl="true" />
            </rule>
        </rules>
    </rewrite>

Is there a way to get rid of this behavior and leave main web.config as it is?

Was it helpful?

Solution

In AWS Forum I found the answer: not supported https://forums.aws.amazon.com/thread.jspa?messageID=309811.

A simple additional settings to disable this URL Rewrite would be enough, let's hope Amazon will add it in future .NET SDK releases

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top