当前位置:网站首页>Solve the problem of uni - app packaged H5 website to download image
Solve the problem of uni - app packaged H5 website to download image
2022-08-02 03:54:00 【auspi12341】
Receive an H5 packaged app project, in which the shared image is different from the H5 website, use the A tag download to download the image because there is a cross-domain problem, it directly opens a new window instead of downloading the image
Solution:
Use nginx reverse proxy function
location ^~ /static/rcode/{proxy_pass http://xxx.com/static/rcode/;proxy_set_header Host xxx.com;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header REMOTE-HOST $remote_addr;add_header X-Cache $upstream_cache_status;#Set Nginx Cacheset $static_fileFRUN9puK 0;if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ){set $static_fileFRUN9puK 1;expires 12h;}if ( $static_fileFRUN9puK = 0 ){add_header Cache-Control no-cache;}}Solve the problem of cross-domain pictures and realize the download function
边栏推荐
猜你喜欢
随机推荐
require modular syntax
easyswoole 使用redis执行geoRadiusByMember Count无效修复
IO流、 编码表、 字符流、 字符缓冲流
如何根据地图上的两个坐标点来确定方向
[symfony/mailer]一个优雅易用的发送邮件类库
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
Living to detect the Adaptive Normalized Representation Learning for GeneralizableFace Anti - Spoofing reading notes
Advanced gradient of skeleton effect, suitable for waiting for pictures
js 正则中 replace() 使用
(2)Thinkphp6模板引擎**标签
js __proto__、prototype、constructor的关系
每日五道面试题 2022/7/27
每日面试题 2022/7/28
解决5+APP真机测试无法访问后台(同局域网)
js预编译 GO 和AO
解决uni-app 打包H5网站 下载图片问题
1.10今日学习
SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
ES6三点运算符、数组方法、字符串扩展方法
微信小程序自定义swiper轮播图面板指示点|小圆点|进度条








