Upstream setup with proxy and fastcgi?

Francis Daly francis at
Mon Apr 18 23:02:26 MSD 2011

On Mon, Apr 18, 2011 at 02:45:15PM -0400, TECK wrote:

Hi there,

> Thanks Francis. My goal is to install Nginx only into load balancer.

Ok. But you have mentioned

 upstream proxy {  
  server 1.localserverip:8000;
  server 2.localserverip:8000;
  server 3.localserverip:8000;
  server 4.localserverip:8000;

and proxy_pass talks to a http server. So, what http server will you
have listening on port 8000, if not nginx?

If you follow Igor's "don't proxy static", then it doesn't matter. And
if you let the load balancer know about the fastcgi stuff, then it also
doesn't matter.

> location ~ \.php$ {
> fastcgi_pass php;
> include fastcgi.conf;
> }
> Can you give me a real example? Location [php urls] is not really clear
> for me.

You want something that will match all of the requests that should be
handled by the fastcgi server, and will match none of the requests that
should not be.

If "location ~ \.php$" works for you, stick with it.

Exactly what you have working already, should keep working. If it doesn't,
then the generated error information will be interesting.

What happened when you tried it?

Good luck,

Francis Daly        francis at

More information about the nginx mailing list