web.config 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. This configuration file is required if iisnode is used to run node processes behind
  4. IIS or IIS Express. For more information, visit:
  5. https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
  6. -->
  7. <configuration>
  8. <system.webServer>
  9. <webSocket enabled="false" />
  10. <handlers>
  11. <!-- Indicates that the app.js file is a node.js site to be handled by the iisnode module -->
  12. <add name="iisnode" path="src/app.js" verb="*" modules="iisnode"/>
  13. </handlers>
  14. <rewrite>
  15. <rules>
  16. <!-- Do not interfere with requests for node-inspector debugging -->
  17. <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
  18. <match url="^src/app.js\/debug[\/]?" />
  19. </rule>
  20. <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
  21. <rule name="StaticContent">
  22. <action type="Rewrite" url="public{PATH_INFO}"/>
  23. </rule>
  24. <!-- All other URLs are mapped to the node.js site entry point -->
  25. <rule name="DynamicContent">
  26. <conditions>
  27. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
  28. </conditions>
  29. <action type="Rewrite" url="src/app.js"/>
  30. </rule>
  31. </rules>
  32. </rewrite>
  33. <!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
  34. <security>
  35. <requestFiltering>
  36. <hiddenSegments>
  37. <remove segment="bin"/>
  38. </hiddenSegments>
  39. </requestFiltering>
  40. </security>
  41. <!-- Make sure error responses are left untouched -->
  42. <httpErrors existingResponse="PassThrough" />
  43. <!--
  44. You can control how Node is hosted within IIS using the following options:
  45. * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
  46. * node_env: will be propagated to node as NODE_ENV environment variable
  47. * debuggingEnabled - controls whether the built-in debugger is enabled
  48. See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
  49. -->
  50. <!--<iisnode watchedFiles="web.config;*.js"/>-->
  51. </system.webServer>
  52. </configuration>