I am running a node.js application under iisnode (an extension for IIS that allows node.js to manage requests through IIS). By default iisnode gives access to a debugging tool at http://myapp.com/debug
. However Windows Azure Websites overrides this (probably by accident) with a urlrewrite in web.config.
<system.webServer>
<handlers>
<add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="app.js"/>
</rule>
</rules>
</rewrite>
<iisnode
debuggingEnabled="true"
devErrorsEnabled="true"
debuggerPathSegment="debug"
nodeProcessCommandLine=""%programfiles(x86)%\nodejs\node.exe""
logDirectory="..\..\LogFiles\nodejs"
watchedFiles="*.js;iisnode.yml;node_modules\*;views\*.jade;views\*.ejb;routes\*.js" />
</system.webServer>
I don't know much about web.config rewrite but it looks to me like <action type="Rewrite" url="app.js"/>
is routing all requests to app.js (my main application file) as long as the request does not match an actual static file on the server. This is great except I don't want /debug
to be routed to app.js, I want to let iisnode handle that request by default like it is supposed to. If I remove the <action />
rewrite /debug
does indeed pull up the iisnode debugger, but then nothing else works of course :P
How can I modify this url rewrite to avoid /debug
?