Forum: NGINX Proxy_pass and rewrite

0a019cdcadce60a9d631a0968790a585?d=identicon&s=25 Rodrigo Serra Inacio (Guest)
on 2013-08-09 20:01
(Received via mailing list)
Hi, I'm try to do a proxy_pass and rewrite rules like this:

location /directory/ {
                        proxy_pass http://some_url_to_proxy_pass/;
                        expires +10d;
                }

It's working, but I need to repeat the /directory/ on the new url to
work
...like this
http://testurl.com/directory/directory/foo/bar/

And I want just one /directory/foo/bar/...then a try a rewrite rule,
like
this

location /directory/ {
                        proxy_pass http://some_url_to_proxy_pass/;
                        rewrite /directory/(.*) $1 break;
                        expires +10d;
                }

But, isn't work
Some help, please.
Thanks
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.