【Nginx】浏览器请求URL遇到错误:no-referrer-when-downgrade
前言nginx 1.15.8.1no-referrer-when-downgrade解决办法在nginx中(nginx.conf)添加允许跨域的配置:server{listen 80 ;server_name localhost ;root /www/admin/localhost_80/wwwroot/ ;location / {index index.html;}...# 流媒体locatio
·
前言
- nginx 1.15.8.1
no-referrer-when-downgrade
解决办法
在nginx中(nginx.conf)添加允许跨域的配置:
server{
listen 80 ;
server_name localhost ;
root /www/admin/localhost_80/wwwroot/ ;
location / {
index index.html;
}
...
# 流媒体
location ^~ /stream/hls1/ {
# 跨域问题的配置
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow_Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range' always;
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH' always;
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /data/stream/hls1/;
expires -1;
}
}
更多推荐
已为社区贡献37条内容
所有评论(0)