I have a fairly standard node app deployed to Azure. By default, for a request of http:www.example.com/my_path Azure adds a web.config xml file to set up IIS so it will:
a) see if a static file matching /my_path exists in the /public folder
b) route all other requests to the nodejs app.
That's close to what I want, except that for the root path (http:www.example.com/) I want it to just display public/index.html, and at the moment it routes the root path to the node app.
I'm unable to get it to do that. Here's the relevant section from my web.config:
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
<!-- WHAT SHOULD THIS NEXT LINE BE TO IGNORE THE BASE PATH
FROM THIS RULE TO SEND REQUESTS TO THE NODE APP? -->
<add input="{REQUEST_URI}" pattern="^$" negate="True"/>
</conditions>
<action type="Rewrite" url="server.js"/>
</rule>