On Jul 30, 2007, at 16:47 , Toby DiPasquale wrote:
I'm using nginx and what I'd like to occur is the following: I'd like
to host multiple apps, each hosted on their own Web server on
different ports on the local machine. I'd like for nginx to proxy
between these apps based on an URL path prefix, e.g.

http://localhost/path/place?query=1  -->  http://localhost:8080/place?query=1

My config is pretty simple and looks like:

location / {
    root /var/www/html;
}
location /path/ {
    rewrite   ^/path/(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8080;
}

However, when I click on an href="/path" link, I am sent back to the
index page. Why is it not proxying the rewritten URL back to the
instance on port 8080? How can I make it do that? Thanks for all your
help.

I may be incorrect yet I think that the / location gets picked up and processed for /path before the /path/ one hence you're hitting your index page. So try reversing the order of the location statements with location / last.

--
Wayne E. Seguin
Sr. Systems Architect & Systems Admin