当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MySql Advanced -- Constraints
Function hoisting and variable hoisting
DVWA靶机安装教程
TCP communications program
2.PHP变量、输出、EOF、条件语句
线程池(线程池介绍与使用)
多线程(实现多线程、线程同步、生产者消费者)
12.什么是JS
Various ways of AES encryption
1.uview form校验位置可以改变 2.时间区间
微信小程序云开发之券码领取,怎么防止用户领取到相同的数据?
稳定好用的短连接生成平台,支持API批量生成
IO流、 编码表、 字符流、 字符缓冲流
Relative and absolute paths
display,visibility,opacity
我的小笔记 =》原生微信小程序
1.13 学习JS
clock tick marks
DOM manipulation---magnifying glass case
v-on基本使用、参数传递、修饰词









