Need to proxypass to different servers.

Geo P.C. pcgeopc at
Tue Mar 19 14:12:25 UTC 2013

Thanks for your reply. Please see this:

In Proxy server we have the setup as follows:

server {

  listen 80;


                 proxy_buffering on;

 proxy_redirect     off;

                proxy_set_header   Host             $host;

                proxy_set_header   X-Real-IP        $remote_addr;

                 proxy_set_header   X-Forwarded-For

location / {

                                proxy_pass;  #app1


location /cms {

                                proxy_pass;   #
app2 server



Now while accessing the url the result are as follows:

1. à Working fine getting the contents of app1 server

2. à Working fine getting the contents of app1 server

3. à Not working. Site proxypass to app2 server but
we are getting a 404 page.

4. àSame as above result.

For your information the cms application running app2 server is graphite
server and you can find the nginx configuration file from the url: in which we use the server name as

So can you please help us on it.



On Tue, Mar 19, 2013 at 2:50 PM, Francis Daly <francis at> wrote:

> On Tue, Mar 19, 2013 at 09:25:09AM +0530, Geo P.C. wrote:
> Hi there,
> > We have 3 servers with Nginx as webserver. The setup is as follows:
> > So in proxy server we need to setup as while accessing and
> all
> > its subdirectories like* it should go to app server 1
> except
> > while accessing and its subdirectories it should go to
> app
> > server2.
> >
> > Please let us know how we can configure it.
> "location /cms" should have "proxy_pass" to app2, "location /" should have
> "proxy_pass" to app1. Almost exactly as you show. Except that you spell
> "cms" "ui", for some reason.
> > In proxy server we setup as follows but is not working:
> Be specific.
> What one request do you make that does not give the response that you
> expect? What response do you get instead?
> Other things: you must set the world up so that the browser actually
> gets to your proxy server when requesting That's outside
> of anything nginx can do.
> You must set things up so that nginx actually gets to your app2 server
> when...
> >                                 proxy_pass;
> ...using the name That needs a working resolver, or a configured
> upstream block. Or just use the IP address directly here.
> And you will *probably* want to make sure that everything on app2 knows
> that it is effectively being served below /cms, as otherwise any links
> to other resources on that server may not work as you want.
> (And note that "location /cms" and "location /cms/" do different things,
> and may not both be what you want.)
>         f
> --
> Francis Daly        francis at
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list