Forum: NGINX Full pathname not sent

Cbd66b454cb337d701b5086092e71a30?d=identicon&s=25 Doc (Guest)
on 2014-03-23 17:03
(Received via mailing list)
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;
}

However the pathname received by thttpd is /test/ without the mp3
filename.
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 Francis Daly (Guest)
on 2014-03-24 14:14
(Received via mailing list)
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 Daly        francis@daoine.org
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.