proxy server needs to point to two servers

Francis Daly francis at
Fri Jun 29 19:50:07 UTC 2012

On Fri, Jun 29, 2012 at 02:42:16PM -0400, x7311 wrote:

Hi there,

> So I can access production as  http://public_url/app1, 
> http://public_url/app2,  http://pbulic_url/app3
> and development as
> http://public_url/dev/app1, etc  (actually, dev.public_url) would be a
> better option.

dev.public_url is probably easier to use, with your configuration below.

The server_name directive is used to choose which one server will handle
this request. Because you have two server blocks with the same server_name
values, the second one will never be used.

> server {
>         listen 80;
>         client_max_body_size 200M;
>         server_name localhost;

Probably include public_url there, if that is the name that you are
using to access the server.

> My attempt with the second server block...
> server {
>         listen 80;
>         client_max_body_size 200M;
>         server_name localhost;

and include dev.public_url there, so that this server block has a chance
of being used.

Once you are using this server block, then you can see if there are any
problems with the configuration inside it. It might all work perfectly

Francis Daly        francis at

More information about the nginx mailing list