canvas跨域完美解决,微信头像解决跨域
2018-01-25 17:49
344 查看
最新的需求中需要把微信头像作为截图的一部分,但是涉及到跨域
解决方案:
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-Modified- Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
proxy_pass http://wx.qlogo.cn/; }
然后将微信的头像 http://wx.qlogo.cn/xxx => http://${自己的域名}/wechat_image/xxx
解决方案:
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-Modified- Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
proxy_pass http://wx.qlogo.cn/; }
然后将微信的头像 http://wx.qlogo.cn/xxx => http://${自己的域名}/wechat_image/xxx
相关文章推荐
- Ajax跨域请求COOKIE无法带上的完美解决办法
- thinkphp ajax 跨域请求 Access-Control-Allow-Origin 完美解决
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- 记一次iphone 微信内置浏览器跨域无法获取cookie问题的解决方法
- html2canvas截屏跨域图片解决办法
- 解决cocos creator访问微信头像链接不成功问题!
- 解决cocos creator访问微信头像链接不成功问题!
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- 使用jsonp完美解决跨域问题
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法
- ajax跨域问题完美解决
- 谷歌、火狐浏览器下实现JS跨域iframe高度自适应的完美解决方法,跨域调用JS不再是难题!
- React+Spring实现跨域问题的完美解决方法
- 【TaoTao】使用JQueryJsonp 完美解决JS跨域问题
- angularJs解决跨域问题-最简单的完美实例
- 完美解决mui框架off-canvas侧滑超出部分隐藏无法滚动的问题
- Ajax跨域、Json跨域、Socket跨域和Canvas跨域等同源策略限制的解决方法