Windows Azure Web Site (18) Azure Web App设置MIME
《Windows Azure Platform 系列文章目录》
在笔者之前的文章中,介绍了我们在使用Azure Web App,可以把静态资源保存到Azure Storage中:
Windows Azure HandBook (7) 基于Azure Web App的企业官网改造
这样动态的请求会发送到Azure Web App,静态的图片请求会发送到Azure Storage中
减少Azure Web App对于主机带宽的压力。
但是在某些时候,我们还是会把静态资源放在和Web代码里。比如我们部署的Web App代码是正常的。

然后在这个ASP.NET代码目录里,有一个MP4文件。如下图:

但是我们访问这个MP4页面,会发现404 Page Not Found:

这个问题的主要原因是,Web App针对MP4文件没有设置MIME。
我们可以修改Web App的Web.config文件,增加MIME配置,如下图:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
</staticContent>
</system.webServer>
</configuration>
这样Web App就能正常播放MP4文件了:

Windows Azure Web Site (18) Azure Web App设置MIME的更多相关文章
- Windows Azure Web Site (14) Azure Web Site IP白名单
<Windows Azure Platform 系列文章目录> 我们知道,在Azure Cloud Service和Virtual Machine,可以通过Endpoint ACL (Ac ...
- Windows Azure Web Site (16) Azure Web Site HTTPS
<Windows Azure Platform 系列文章目录> 我们在使用微软云Azure Web App的时候,会使用微软的二级域名:http://xxx.chinacloudsites ...
- Windows Azure Web Site (17) Azure Web Site 固定公网IP地址
<Windows Azure Platform 系列文章目录> 在之前的文档中,笔者介绍了Azure Web Site是一个多租户的环境,每个部署单元有一个可以通过Internet访问的入 ...
- Windows Azure Web Site (12) Azure Web Site配置文件
<Windows Azure Platform 系列文章目录> 本文将介绍如何在Azure Web Site里配置连接字符串. 本文分为以下几个步骤: 1.在本地ASP.NET项目使用W ...
- Windows Azure Web Site (13) Azure Web Site备份
<Windows Azure Platform 系列文章目录> 我们在使用Windows Azure Web Site的时候,经常会遇到需要对Web Site进行备份的情况.在这里笔者简单 ...
- [New Portal]Windows Azure Web Site (3) 创建Web Site和云端数据库
<Windows Azure Platform 系列文章目录> 在前一章的内容里,我介绍了使用Windows Azure Management Portal创建Web Site.本章,我将 ...
- Windows Azure Web Site (19) Azure Web App链接到VSTS
<Windows Azure Platform 系列文章目录> 之前遇到一个问题,客户在海外使用 我参考了一下国内Azure China的文档:https://school.azure.c ...
- [New Portal]Windows Azure Virtual Machine (18) Azure Virtual Machine内部IP和外部IP
<Windows Azure Platform 系列文章目录> 在开始本章内容之前,请读者熟悉以下2篇博文: [New Portal]Windows Azure Virtual ...
- Windows Azure Web Site (8) 设置Web Site时区
<Windows Azure Platform 系列文章目录> 许多已经使用Azure Web Site的用户已经发现了,Azure Web Site默认的系统时间是UTC时区. 比如我们 ...
随机推荐
- Opencv-Python 图像透视变换cv2.warpPerspective
# -*- coding:utf-8 -*- import cv2 import numpy as np import sys img = cv2.imread('test.jpg') # cv2.i ...
- Python学习笔记第四周
目录 一.基础概念 1.装饰器 1.装饰器本质就是函数 2.实现装饰器知识储备 1.函数即变量 2.高阶函数 3.嵌套函数 例子 1.将一个函数名作为实参传递给另外一个函数 2.返回值为函数名 3.函 ...
- UDP方式实现广域网的P2P通信
最近在研究P2P通信,希望能够穿透路由器. 当前的做法只是使用TCP协议进行客户端与服务器端通信,使用UDP协议进行客户端之间的打洞操作,UDP的方式的源码在下方. 一直没有实现TCP的打洞,如果有实 ...
- scrapt中的数据提取,采用js2xml库
这个一个爬去美团的例子,应为数据都是在script中,小心封ip,尽量少运行. 先导入库几个库 import requests from bs4 import BeautifulSoup from l ...
- HDU2019数列有序!
Problem Description 有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序. Input 输入数据包含多个测 ...
- Quick Noodle Physics in Blender Tutorial
https://www.youtube.com/watch?v=Lg7jxAMs60QQuick Noodle Physics in Blender Tutorial 新增平面Plane作为地面; 新 ...
- Python下载与安装配置
最近想学习Python那就开始吧 首先就是下载安装了 Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到: Python官网:https://www.python.org/ 你 ...
- 用setuptools_scm来自动控制Python包的版本
手动管理Python包的版本号一段时间后,寻求自动化的手段,是自然而然的. 手动管理版本 手动管理Python包的版本,需要注意两个方面: 每次发布新包前,要更新包的版本号. 在安装后的默认模块下应该 ...
- Top PG Clustering HA Solutions for PostgreSQL
转自:https://severalnines.com/blog/top-pg-clustering-ha-solutions-postgresql If your system relies on ...
- Babelfish 基本试用
测试使用docker 部署 docker-compose文件 注意网络模型选择的host,同时配置了opentracing 服务 version: "3" services: b ...