iisnode icon indicating copy to clipboard operation
iisnode copied to clipboard

web.config iisnode section breaks app

Open djholly123 opened this issue 12 years ago • 2 comments

Hi

When I try and add iisnode settings to my apps web.config .breaks the express app with 500 error. even adding makes app break ... Am I mssing something ?

Thanks

web.config: <system.webServer>

<!-- indicates that the hello.js file is a node.js application 
to be handled by the iisnode module 
<iisnode promoteServerVars="AUTH_USER,AUTH_TYPE" />

-->

<handlers>
  <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
    <rules>
        <!-- Don't interfere with requests for node-inspector debugging -->
        <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
            <match url="^server.js\/debug[\/]?" />
        </rule>

        <!-- 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 application entry point -->
        <rule name="DynamicContent">
            <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
            </conditions>
            <action type="Rewrite" url="server.js" />
        </rule>
    </rules>

   </rewrite>

</system.webServer>

djholly123 avatar Jul 31 '14 19:07 djholly123

if you remove "<iisnode promoteServerVars="AUTH_USER,AUTH_TYPE" />", does it work? Is this on Azure Websites OR IIS ?

Check your applicationHost.config file to see if <section name="iisnode" /> is present under system.webServer

rramachand21-zz avatar Jul 31 '14 19:07 rramachand21-zz

Hi Thanks for response

its iis7 and yes app worked without the setting.

but ...

  1. Fix was to install latest iisnode
  2. configure the web site with windows only authentication and ensure the site can serve a index.htm page externally (local domain) without login prompt.
  3. restart iis

now getting the variable in my node app the is what I need

Man Thanks

djholly123 avatar Aug 01 '14 07:08 djholly123