Tag: web config

使用节点和Azure WebApp自定义静态错误页面

我正在使用Azure WebApps构build一个静态页面和节点网站的混合体,我想要一个自定义的404页面,但我不能使其工作。 大多数网站是静态的,但我有一些需要服务器代码的路线。 我的web.config如下所示: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <httpProtocol> <customHeaders> <remove name="X-Powered-By"/> <add name="x-dns-prefetch-control" value="on"/> </customHeaders> </httpProtocol> <handlers> <add name="iisnode" path="src/server/index.js" verb="*" modules="iisnode"/> </handlers> <rewrite> <rules> <rule name="static"> <match url="(?!dynamicroute).*$" ignoreCase="true"/> <action type="Rewrite" url="dist{REQUEST_URI}"/> </rule> <rule name="dynamic"> <match url="(?:dynamicroute)(.*)$" ignoreCase="true"/> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/> </conditions> <action type="Rewrite" url="src/server/index.js"/> </rule> </rules> </rewrite> <!– Make […]

在Azure中为SVG和字体显示NodeJS web.config

我在快速网站中遇到了问题,该网站使用SVG和其他文件,如字体。 在本地运行应用程序时没有任何问题,但是一旦在Azure上部署,SVG和字体就不会再出现。 在项目根目录下创build一个web.config文件: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> <mimeMap fileExtension=".woff" mimeType="application/x-woff" /> <mimeMap fileExtension=".ttf" mimeType="application/x-woff" /> </staticContent> </system.webServer> </configuration> 也使用这个解决scheme:( Windows Azure中的Svgs和其他MIMEtypes ) 这两个解决scheme现在允许加载SVG文件,但网页不再加载。 (HTTP 500) 它似乎覆盖dynamic内容的configuration。 如何configurationdynamic内容,使应用程序再次工作?

Windows Azure网站正在覆盖我的node.js应用程序中的404和500错误页面

我正在使用Windows Azure网站托pipenode.js应用程序。 到目前为止,除了我的自定义错误,一切都很好。 在我的节点应用程序中,我有一个error handling程序,可以在我的本地机器上呈现自定义404和自定义500错误页面。 但是,只要我发布到azure它将覆盖响应时,我将statusCode设置为除200以外的任何内容。 如果我没有将500或404状态码传递给响应,则不会发生这种情况,但是我希望状态码能够传递给浏览器。 本地我得到我的自定义错误页面就好了: 但是,在azure色的网站上,它只返回一行文字: 页面无法显示,因为发生了内部服务器错误。 我试图创build自己的web.config来覆盖默认的自定义错误禁用,但似乎没有任何效果。 这是我的web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <customErrors mode="off" /> </system.web> <system.webServer> <handlers> <add name="iisnode" path="app.js" verb="*" modules="iisnode"/> </handlers> <rewrite> <rules> <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="app.js"/> </rule> </rules> </rewrite> <iisnode debuggingEnabled="true" devErrorsEnabled="true" debuggerPathSegment="debug" […]