location 中添加 add_header Access-Control-Allow-Origin *;(不需要放crossdomain.xml文件)
http {
server {
listen 80;
location /live {
add_header Access-Control-Allow-Origin *; //处理跨域问题
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /usr/local/nginx/html/hls;
expires -1;
add_header Cache-Control no-cache;
}
location / {
root html;
index index.html index.htm;
}
}
}