title: Why doesn't Nodejs app work on Windows IIS
body: <p>I use nodejs app with express i want to host on windows IIS. On my IIS8 nodejs is working. but I got an error 'Cannot GET /node/server.js' and I put rewrite rules in web.config. then I got the following error. </p>
  
  <blockquote>
    <p>HTTP Error 500.19 - Internal Server Error
    The requested page cannot be accessed because the related configuration data for the page is invalid.</p>
  </blockquote>
  
  <p>I discovered on internet. everyone suggest the following configuration but is not working on my windows</p>
  
  <p>my web.config file is:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.webServer&gt;
  &lt;handlers&gt;
    &lt;add name="iisnode" path="server.js" verb="*" modules="iisnode" /&gt;
  &lt;/handlers&gt;
  &lt;defaultDocument&gt;
    &lt;files&gt;
      &lt;add value="server.js" /&gt;
    &lt;/files&gt;
  &lt;/defaultDocument&gt;
  &lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true"&gt;
        &lt;match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$"/&gt;
      &lt;/rule&gt;
      &lt;rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"&gt;
        &lt;match url="^server.js\/debug[\/]?" /&gt;
      &lt;/rule&gt;
      &lt;rule name="StaticContent"&gt;
        &lt;action type="Rewrite" url="public{REQUEST_URI}"/&gt;
      &lt;/rule&gt;
      &lt;rule name="DynamicContent"&gt;
        &lt;conditions&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/&gt;
        &lt;/conditions&gt;
        &lt;action type="Rewrite" url="server.js"/&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  &lt;iisnode nodeProcessCountPerApplication="8" watchedFiles="*.js;node_modules\*;routes\*.js;views\*.html"/&gt; 
  &lt;/system.webServer&gt; 
  &lt;/configuration&gt;
  </code></pre>
  
  <p>any suggestion?
  Thanks</p>