我正在構建一個應用程序,使用nodejs express來執行其他api服務。 我使用iisnode module在windows server 2012上託管了該應用程序。一切都很完美。 問題是,當我從節點應用程序返回404(未授權)消息時,終點是通過iis的錯誤頁面接收401 http狀態。 有沒有其他方法可以解決這個問題。iisnode 401消息返回iis頁
這裏是我的webconfig文件
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="app.js" verb="*" modules="iisnode" />
</handlers>
<!-- use URL rewriting to redirect the entire branch of the URL namespace
to hello.js node.js application; for example, the following URLs will
all be handled by hello.js:
http://localhost/node/express/myapp/foo
http://localhost/node/express/myapp/bar
-->
<rewrite>
<rules>
<rule name="/">
<match url="/*" />
<action type="Rewrite" url="app.js" />
</rule>
</rules>
</rewrite>
我的應用程序的NodeJS代碼下面的advanc
if(clienttoken!=servertoken)
{
res.json(401, 'unauthorized');
res.end();
}
謝謝e
你好Tom 。謝謝你的支持。,我試過上面的那個。但是我得到了內部服務器錯誤 – M14
嗯,我目前沒有訪問我的iis服務器。我從我鏈接的文檔頁面調整了這個例子,所以也許有一個通讀的例子 –