Forum: NGINX Proxy_pass and rewrite

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.