小编ome*_*kan的帖子

如何覆盖 nginx.conf 位置块中的 http Content-Disposition 标头?

我有一个反向代理服务器,它从文件服务器获取文件,然后将它们发送给用户。我想在发送之前更改文件名。我写了如下规则

location ~ downloads/(.*) {          
        proxy_pass         http://HOST:PORT/remote.php/dav/files/$1;
        add_header Content-Disposition 'attachment; "filename=$args"';
   }
Run Code Online (Sandbox Code Playgroud)

但是当我发送请求时我收到此错误;

ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
Run Code Online (Sandbox Code Playgroud)

http nginx nginx-reverse-proxy nextcloud

2
推荐指数
1
解决办法
5788
查看次数

标签 统计

http ×1

nextcloud ×1

nginx ×1

nginx-reverse-proxy ×1