当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
关于tp的apache 的.htaccess文件
每日五道面试题总结 22/7/19
js takes the value of a feature at a certain position in the string, such as Huawei=> Huawei
解决MySQL创建子视图并查看的时候,字符集报错问题
vue3 访问数据库中的数据
使用PHPMailer发送邮件
面试总结 22/7/25 面试中的重点
(2)Thinkphp6模板引擎**标签
JS对象, 函数和作用域
ES6介绍+定义变量+不同情况下箭头函数的this指向
[symfony/finder]最好用的文件操作库
uniapp | 开发中遇到的兼容性问题(待续)
Advanced gradient of skeleton effect, suitable for waiting for pictures
微信小程序九宫格抽奖和转盘抽奖的实现
2.PHP变量、输出、EOF、条件语句
Guangzhou Huawei Interview Summary
5.20今日学习
微信小程序全局组件的定义
阿里云服务器如何使用admin账户登录
14.JS语句和注释,变量和数据类型