解決canvas微信頭像跨域問題

只需在nginx配置微信圖片轉發處理就好,加上如下代碼:

location ^~ /wechat_image/ {
    add_header 'Access-Control-Allow-Origin' "$http_origin" always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Mod    ified-  Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
    proxy_pass http://wx.qlogo.cn/;
 }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章