MP4 的 Azure Web 应用配置
Azure web app configuration for MP4
我的 Azure webapp 似乎有一个奇怪的问题。我根本无法在浏览器上查看 MP4 文件。在这里浏览了几篇文章后,我做了以下事情:
我使用 Github 持续部署,所以我创建了一个名为 "Web.config" 的新文件。内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
我在 FTP 上确定该文件存在于“/site/wwwroot”目录中,它确实存在。我还确保 MP4 文件存在于 FTP 的可访问位置。
我在网站上得到的错误如下:
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
谁能帮我调试这个问题?
经过我们的讨论,您的 web.config 是正确的。
您必须确保将它定位在正确的位置以使其正常工作(在您的情况下为虚拟应用程序根目录)。
由于 Azure App Service 使用 IIS,您可以在此处找到有关 IIS 配置文件的更多详细信息:http://www.iis.net/learn/get-started/planning-your-iis-architecture/deep-dive-into-iis-configuration-with-iis-7-and-iis-8
希望对您有所帮助,
我的 Azure webapp 似乎有一个奇怪的问题。我根本无法在浏览器上查看 MP4 文件。在这里浏览了几篇文章后,我做了以下事情: 我使用 Github 持续部署,所以我创建了一个名为 "Web.config" 的新文件。内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
我在 FTP 上确定该文件存在于“/site/wwwroot”目录中,它确实存在。我还确保 MP4 文件存在于 FTP 的可访问位置。
我在网站上得到的错误如下:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
谁能帮我调试这个问题?
经过我们的讨论,您的 web.config 是正确的。 您必须确保将它定位在正确的位置以使其正常工作(在您的情况下为虚拟应用程序根目录)。
由于 Azure App Service 使用 IIS,您可以在此处找到有关 IIS 配置文件的更多详细信息:http://www.iis.net/learn/get-started/planning-your-iis-architecture/deep-dive-into-iis-configuration-with-iis-7-and-iis-8
希望对您有所帮助,