/ / IISNode - IIS7.0 - Problema de web.config inválido no Windows 2008 R2 - node.js, iis, iisnode

IISNode - IIS7.0 - Problema de web.config inválido no Windows 2008 R2 - node.js, iis, iisnode

Eu estou tentando implantar um aplicativo node.js para o IIS 7.0 hospedado em máquina Windows 2008 usando o módulo IISNode. Eu tenho o seguinte arquivo web.config -

<configuration>
<system.webServer>
<webSocket enabled="false" />
<handlers>
<add name="iisnode" path="build/index.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Do not interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^build/server.js/debug[/]?" />
</rule>

<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>

<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="build/index.js"/>
</rule>
</rules>
</rewrite>

<security>
<requestFiltering>
<hiddenSegments>
<remove segment="bin"/>
</hiddenSegments>
</requestFiltering>
</security>
<httpErrors existingResponse="PassThrough" /></system.webServer></configuration>

Quando eu navego para o site - ele dá um HTTPErro 500.19 erro interno do servidor reclamando de web.config inválido. Essa configuração exata está funcionando no aplicativo azul sem qualquer problema. Eu também instalei o módulo Rewrite.

Se alguém se deparou com esta questão e qualquer ajuda seria muito apreciada.

Muito Obrigado.

EDITADO - Problema estava com a seguinte linha -

<webSocket enabled="false" />

Remover isso resolveu o problema. Mas eu tenho seguinte erro ao tentar acessar o site -

iisnode não pôde estabelecer conexão de pipe nomeado para o processo node.exe antes do processo ser encerrado

Respostas:

0 para resposta № 1

que tal este web.config?

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

<!-- "bin" directory has no special meaning in node.js and apps can be placed in it -->
<security>
<requestFiltering>
<hiddenSegments>
<remove segment="bin"/>
</hiddenSegments>
</requestFiltering>
</security>

<!-- Make sure error responses are left untouched -->
<httpErrors existingResponse="PassThrough" />

<!--
You can control how Node is hosted within IIS using the following options:
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
* node_env: will be propagated to node as NODE_ENV environment variable
* debuggingEnabled - controls whether the built-in debugger is enabled

See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
-->
<!--<iisnode watchedFiles="web.config;*.js"/>-->
</configuration>

0 para resposta № 2

Basicamente, o último problema foi um problema de permissões no meu caso - eu tive que dar controle total ao grupo IIS_Users para a pasta do aplicativo do nó e funcionou para mim.

Obrigado.