Why doesn't Nodejs app work on Windows IIS

Volkan Akın Paşa

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.

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

I discovered on internet. everyone suggest the following configuration but is not working on my windows

my web.config file is:

<configuration>
  <system.webServer>
<handlers>
  <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<defaultDocument>
  <files>
    <add value="server.js" />
  </files>
</defaultDocument>
<rewrite>
  <rules>
    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$"/>
    </rule>
    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^server.js\/debug[\/]?" />
    </rule>
    <rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
    </rule>
    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
      </conditions>
      <action type="Rewrite" url="server.js"/>
    </rule>
  </rules>
</rewrite>
<iisnode nodeProcessCountPerApplication="8" watchedFiles="*.js;node_modules\*;routes\*.js;views\*.html"/> 
</system.webServer> 
</configuration>

any suggestion? Thanks

ziyasal

Your configuration file looks valid. So, you have to install iis rewrite extension and it works well.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Why wmctrl doesn't work for certain windows?

분류에서Dev

NodeJS randomly doesn't work

분류에서Dev

Why isEOF doesn't work?

분류에서Dev

Why json doesn´t work?

분류에서Dev

Why doesn't isdigit() work?

분류에서Dev

launchExternal doesn't work on XDK app on Android

분류에서Dev

Why doesn't LibreOffice work with the HUD?

분류에서Dev

Why doesn't this math work with macros?

분류에서Dev

Why doesn't beep work in Ubuntu?

분류에서Dev

Why doesn't my SetLength work?

분류에서Dev

why the click() function doesn't work?

분류에서Dev

Why doesn't this simple enable_if work?

분류에서Dev

Why doesn't this Mongoose query work?

분류에서Dev

Why doesn't my iptables rule work?

분류에서Dev

Why this jQuery doesn't work in Codeigniter?

분류에서Dev

Why doesn't source lib/* work?

분류에서Dev

Jquery Why doesn't toggleClass work here?

분류에서Dev

Why char[] work,but char * doesn't

분류에서Dev

why doesn't history work in Ubuntu?

분류에서Dev

Why doesn't this batch command work as expected?

분류에서Dev

Why doesn't "usermod" work under superuser?

분류에서Dev

Why doesn't my .desktop file work?

분류에서Dev

Why doesn't my Windows Store (Metro) app appear in the Share Pane?

분류에서Dev

Windows Update doesn't work on Window 8.1

분류에서Dev

Helloworld example doesn't work - Do I need to embed NodeJS?

분류에서Dev

Windows 7 computer won't boot and recovery doesn't work

분류에서Dev

Why doesn't Vodafone Mobile broadband work in UK?

분류에서Dev

Why switch case in javascript doesn't work with string on Microsoft Edge?

분류에서Dev

Why APIPA doesn't work with multiple network adapters?