0
点赞
收藏
分享

微信扫一扫

nginx配置跨域

49路末班车 2022-09-13 阅读 230

在nginx的server下面加上
server {
listen 443 ssl;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Requested-With';
add_header 'Access-Control-Allow-Metthods' 'GET,POST,OPTIONS';
location /live {
flv_live on; #打开HTTP播放FLV直播流功能
#https-flv on; chunked_transfer_encoding on; #支持'Transfer-Encoding: chunked'方式回复
或者
add_header 'Access-Control-Allow-Origin' '*'; #添加额外的HTTP头
add_header 'Access-Control-Allow-Credentials' 'true'; #添加额外的HTTP头
}

 

 

举报

相关推荐

0 条评论