# Full pathname not sent

**URL:** <https://www.ruby-forum.com/t/full-pathname-not-sent/239987>\
**Category:** NGINX\
**Created:** [March 23, 2014, 5:03pm UTC](https://www.ruby-forum.com/t/full-pathname-not-sent/239987 "2014-03-23T17:03:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 23, 2014, 5:03pm UTC](https://www.ruby-forum.com/t/full-pathname-not-sent/239987/1 "2014-03-23T17:03:53Z")

</div>

This might be more of a regex problem on my part than nginx. I do a  
rewrite to pass the full pathname to thttpd like this:

location ~ /radio/download/.\*.mp3$ {  
rewrite ^ /test/$1;  
}

location /test {  
proxy\_pass [http://127.0.0.1:8000](http://127.0.0.1:8000);  
}

However the pathname received by thttpd is /test/ without the mp3  
filename.

---

<div class="post-metadata">

**Author:** ![doc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@doc](https://www.ruby-forum.com/u/doc)\
**Post date:** [March 24, 2014, 2:14pm UTC](https://www.ruby-forum.com/t/full-pathname-not-sent/239987/2 "2014-03-24T14:14:17Z")

</div>

On Sun, Mar 23, 2014 at 12:03:25PM -0400, Doc wrote:

Hi there,

> This might be more of a regex problem on my part than nginx.

Yes, it is.

> I do a  
> rewrite to pass the full pathname to thttpd like this:
> 
> location ~ /radio/download/.\*.mp3$ {  
> rewrite ^ /test/$1;  
> }

What value do you want $1 to have?

What does nginx (and pretty much every regex tool) think $1 is?

You’ll probably want () in there somewhere. Look for “capture” in  
the manual.

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
