0

I've tried to follow your recommendations in this answer but I was not able to server static files correctly. I also took a look at the example in this post and even at this gists which is more complete.

Might it be because of this rewrite rule I'm using?

 <match url="/*" />
 <action type="Rewrite" url="bin/www" />

This allows me to access to my app like this:

https://localhost/node/action

Rather than this:

https://localhost/node/myapp/action

I'm using the Virtual Directory name as if it was the app name.

This is my current web.config file:

<configuration>
    <appSettings>
        <add key="virtualDirPath" value="/node" />
    </appSettings>
  <system.webServer>

    <handlers>
      <add name="iisnode" path="bin/www" 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>  
            <match url="/*" />
            <action type="Rewrite" url="bin/www" />
         </rule> 
      </rules>
    </rewrite>

 <iisnode      
      node_env="localhost"
      nodeProcessCountPerApplication="1"
      maxConcurrentRequestsPerProcess="1024"
      maxNamedPipeConnectionRetry="100"
      namedPipeConnectionRetryDelay="250"      
      maxNamedPipeConnectionPoolSize="512"
      maxNamedPipePooledConnectionAge="30000"
      asyncCompletionThreadCount="0"
      initialRequestBufferSize="4096"
      maxRequestBufferSize="65536"
      watchedFiles="*.js;iisnode.yml"
      uncFileChangesPollingInterval="5000"      
      gracefulShutdownTimeout="60000"
      loggingEnabled="true"
      logDirectory="iisnode"
      debuggingEnabled="true"
      debugHeaderEnabled="false"
      debuggerPortRange="5058-6058"
      debuggerPathSegment="debug"
      maxLogFileSizeInKB="128"
      maxTotalLogFileSizeInKB="1024"
      maxLogFiles="20"
      devErrorsEnabled="false"
      flushResponse="false"      
      enableXFF="false"
      promoteServerVars=""
      configOverrides="iisnode.yml"
     />

  </system.webServer>
</configuration>
Ravenous
  • 485
  • 4
  • 14
Alvaro
  • 40,778
  • 30
  • 164
  • 336
  • That doesn't look like javascript. Are you sure you're trying to serve files using node? Or are you trying to serve files using IIS windows server? Because the node server frameworks have static file serving built in. – Ravenous Nov 21 '15 at 00:27
  • web.config? Of course that's not JS, that's a IIS config file. – Alvaro Nov 23 '15 at 10:15
  • And yeah, I know node.js can serve them, but when using IIS with iisnode IIS provides a better performance serving them and to be honest, not quite sure if there's any other alternative anyway. – Alvaro Nov 23 '15 at 10:16

0 Answers0