1. 程式人生 > 其它 >Nginx https轉http 微信內部瀏覽器報跨域問題

Nginx https轉http 微信內部瀏覽器報跨域問題

技術標籤:錯誤記錄nginx

個人部落格地址
用https訪問了http域名,微信內部瀏覽器報跨域問題;類似下圖

解決方案:
在nginx配置檔案對應的location中增加配置

add_header 'Access-Control-Allow-Origin' 'https://news.xionghaizhi.work';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept';

參考部落格園