Skip to content

Instantly share code, notes, and snippets.

@dimavs
Created March 17, 2015 03:16
Show Gist options
  • Save dimavs/ab540cc78b689c2727aa to your computer and use it in GitHub Desktop.
Save dimavs/ab540cc78b689c2727aa to your computer and use it in GitHub Desktop.
<!-- vim: set ts=2 et sw=2 sts=2: -->
<configuration>
<system.web>
<customErrors mode="off" />
</system.web>
<system.webServer>
<httpErrors existingResponse="PassThrough" />
<!-- nodejs entry point -->
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<defaultDocument>
<files>
<add value="server.js" />
</files>
</defaultDocument>
<!-- iisnode config parameters -->
<iisnode
nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;"
watchedFiles="*.js"
enableXFF="true"
/>
<!-- rewrite url for expressjs -->
<rewrite>
<rules>
<rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
<match url="iisnode" />
</rule>
<rule name="StaticContent" stopProcessing="true">
<match url="\.(?:jpg|jpeg|css|png|js|ico|html)$" />
<action type="Rewrite" url="public{REQUEST_URI}" logRewrittenUrl="true" />
</rule>
<rule name="DynamicContent">
<action type="Rewrite" url="server.js"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment