Windows Azure Websites is overriding my 404 and 500 error pages in my node.js app

前端 未结 2 518
长发绾君心
长发绾君心 2020-12-02 20:39

I am using Windows Azure Websites to host a node.js application. So far everything is great except for my custom errors. In my node app I have an error handler that renders

相关标签:
2条回答
  • 2020-12-02 21:02

    Had a similar problem with MVC project hosted in windows azure. On local machine hosted under IIS was working fine but on live machine I was getting the following error "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

    Adding this to web config under system.webServer saved my day

    My web.config looks like this

    <system.web>
       ***
        <customErrors mode="RemoteOnly" defaultRedirect="~/Error/PageNotFound">
          <error statusCode="404" redirect="~/Error/PageNotFound" />
          <error statusCode="500" redirect="~/Error/ServerError"/>
        </customErrors>
      </system.web>
    ***
    <system.webServer>
        <httpErrors existingResponse="PassThrough" />
    </system.webServer>
    
    0 讨论(0)
  • 2020-12-02 21:17

    Well nevermind, I found the issue. If anyone else is having the same problem simply add the following under <system.webServer> in web.config:

    <httpErrors existingResponse="PassThrough" />
    
    0 讨论(0)
提交回复
热议问题