iisnode icon indicating copy to clipboard operation
iisnode copied to clipboard

How do I modify web.config to still allow iisnode debugger to be accessible?

Open AlexAllocated opened this issue 13 years ago • 2 comments

I am running a node.js application under iisnode (Windows Azure Websites). 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="&quot;%programfiles(x86)%\nodejs\node.exe&quot;"
        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 allow the /debug inspector to work?

AlexAllocated avatar Feb 28 '13 20:02 AlexAllocated

The iisnode debugging feature is currently not available in the Windows Azure Websites. It requires cross-process communication mechanisms which are disabled at the OS level in the sandbox in which the applications execute.

tjanczuk avatar Feb 28 '13 22:02 tjanczuk

:'(

Thank you anyway :)

AlexAllocated avatar Feb 28 '13 22:02 AlexAllocated