windows+nginx配置mp4視頻在線播放
其實很簡單,添加幾句代碼就可以了
打開nginx的conf配置文件,在這一段代碼
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
下方添加這段代碼(大概在46行代碼後面)
location ~ .flv {
flv;
}
location ~ .mp4 {
mp4;
}
TIP:該方法支持MP4 ,FLV格式,具體像AVI,MOV,WMV,3GP,等等這些格式是否支持,還未做測試