我正在构建一个应用程序,使用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服务器。我从我链接的文档页面调整了这个例子,所以也许有一个通读的例子 –