当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
面试总结 22/7/22 面试中的重点
一分种一起来了解Vite的基础
What are the PHP framework?
npm and package.json
DVWA靶机安装教程
PHP 给图片添加全图水印
Circular linked list---------Joseph problem
百度定位js API
(2)Thinkphp6模板引擎**标签
阿里云设置域名解析重定向后,无法使用Chrome访问
npm --package.json---require
微信小程序云开发如何将页面生成为pdf?
SQL:DDL、DML、DQL、DCL相应介绍以及演示
如何计算地球上两点的距离(附公式推导)
uniapp | 使用npm update更新后编译报错问题
Living to detect the Adaptive Normalized Representation Learning for GeneralizableFace Anti - Spoofing reading notes
每日五道面试题总结 22/7/21
uniapp | 官方提供的map组件使用问题
When PHP initiates Alipay payment, the order information is garbled and solved
我的小笔记 =》其他东东









