是否可以使用nginx accel标题下载远程文件?我在Firefox中找不到文件,Chrome中的响应无效。
list1 = [d for d in list1 if d.get('title') not in [f.get('title') for f in list2]]
答案 0 :(得分:0)
您必须使用proxy_pass代理远程服务器。例如:
header("Content-Disposition: attachment; filename= 'asd.zip'");
header("Content-Type: application/octet-stream");
header('X-Accel-Redirect: /upload/domain.com/path/to/file.zip');
header("X-Accel-Buffering: yes");
header("X-Accel-Limit-Rate: 102400");
Nginx的
location ~* ^/upload/(.*?)/(.*) {
internal;
set $download_host $1;
set $download_uri $2;
proxy_pass http://$download_host/$download_uri;
}