# $request\_filename rename in download

**URL:** <https://www.ruby-forum.com/t/request-filename-rename-in-download/211968>\
**Category:** NGINX\
**Created:** [September 19, 2011, 1:29am UTC](https://www.ruby-forum.com/t/request-filename-rename-in-download/211968 "2011-09-19T01:29:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 19, 2011, 1:29am UTC](https://www.ruby-forum.com/t/request-filename-rename-in-download/211968/1 "2011-09-19T01:29:01Z")

</div>

Hi,

I have created a public proxy with nginx but when i download files like  
“proxy.\*\*\*\*\*.com/?[url=google.com/images/logo\_sm.gif](http://url=google.com/images/logo_sm.gif)” the filename  
“logo\_sm.gif” it’s not save in browse as the real name but with the  
name: “download”.

I need a rewrite rules that rename the filename with $args of url.  
Eg:  
site.tld/?url=proxed.tld/file.zip

the file.zip will be downloaded as “download” name, not with file.zip  
name. So i need a rule that rename the file with another with:  
site.tld/?url=proxed.tld/file.zip&=filename.zip

This is very easy for who know rewrite of nginx, i searn a lot of  
combination but i loss only time…

Posted at Nginx Forum:

> **[$request\_filename rename in download](https://forum.nginx.org/read.php?2,215361,215361#msg-215361)**
>
> Hi, I have created a public proxy with nginx but when i download files like "proxy.\*\*\*\*\*.com/?url=google.com/images/logo\_sm.gif" the filename "logo\_sm.gif" it's not save in browse as the real name but with the name:...

---

<div class="post-metadata">

**Author:** ![raffo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@raffo](https://www.ruby-forum.com/u/raffo)\
**Post date:** [September 19, 2011, 12:02pm UTC](https://www.ruby-forum.com/t/request-filename-rename-in-download/211968/2 "2011-09-19T12:02:54Z")

</div>

try it  
key=filename

```
      add_header Content-Disposition "attachment; 

```

filename=$arg\_key";

2011/9/19 raffo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
