【问题标题】:Windows Azure osFamily 2 throw error 500 for static filesWindows Azure osFamily 2 为静态文件抛出错误 500
【发布时间】:2013-06-15 08:45:36
【问题描述】:

在将我们的 Web 角色云服务部署到 Windows Azure 中的 osFamily 2 (Windows 2008 R2) 时,我们面临着与 this case 类似的问题。不同之处在于我们是直接的 ASP.NET MVC Web 角色,而不是自定义虚拟机。

osFamily 1 (Windows 2008/IIS 7.0) 上的部署运行良好,我们可以请求静态内容。 (例如 /favicon.ico /404.html)但是当部署到 osFamily 2 时,它只是简单地因错误 500 而中断,没有太多解释。静态文件模块和处理程序映射都已经在这些虚拟服务器中到位。尝试像以前的人一样重新启动,但对我们的情况无济于事。

相同的网络应用程序在我们的 Windows 7/IIS 7.5 工作站上按预期工作。

我们是否忘记了这些在 Windows Azure 中配置的服务器(osFamily 1 没有问题)?

【问题讨论】:

  • 我似乎在新的 Windows Server 2012 R2 映像上遇到了类似的静态文件问题。

标签: azure iis-7.5 windows-server-2008-r2


【解决方案1】:

好吧,有趣的是,在普通的 Windows Server 2008 R2 上没有问题;按预期工作。 Windows Azure 副本的不同之处在于 IIS 7.5 为 .svg 提供了额外的 MIME 类型设置。这是我们在使用 .svg 文件时手动配置到 web.config 中的内容。必须在我们的配置之前放入一个计数器条目以将其删除。

<staticContent xdt:Transform="Replace">
            <remove fileExtension=".svg" />
            <mimeMap fileExtension=".less" mimeType="text/css" />
            <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
            <mimeMap fileExtension=".otf" mimeType="font/opentype" />
            <mimeMap fileExtension=".jsw" mimeType="application/javascript" />
        </staticContent>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-09
    • 2018-12-27
    相关资源
    最近更新 更多