【Nginx】浏览器请求URL遇到错误:no-referrer-when-downgrade
生活随笔
收集整理的這篇文章主要介紹了
【Nginx】浏览器请求URL遇到错误:no-referrer-when-downgrade
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
- 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;} }總結
以上是生活随笔為你收集整理的【Nginx】浏览器请求URL遇到错误:no-referrer-when-downgrade的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 艾叶灰的功效与作用、禁忌和食用方法
- 下一篇: 黄花蒿的功效与作用、禁忌和食用方法