Upstream module - using both fastcgi and http proxy - possible?

Hello,

I am currently trying to setup a nginx setup like the following :

upstream backend {

server unix:/tmp/php.socket weight=10;
server 10.0.0.200:8080 weight=2;

}

The first one is a FASTCGI + the second is a backend PHP proxy that I
want to
use so that if the main one is overloading the server, the backend can
apply
help reduce the load.

Is there any way this can be done ? I’m specifically also asking how I
can
configure the FASTCGI / mod_Proxy parts.

Is my only option to run two NGINX- one for front end ( redirecting to a
local
nginx and a backend server as http proxy) , and the other doing fastcgi
work ?

On śro, lis 26, 2008 at 12:03:28 +0000, Imran wrote:

Hello,

I am currently trying to setup a nginx setup like the following :

upstream backend {

server unix:/tmp/php.socket weight=10;
server 10.0.0.200:8080 weight=2;

}

This is a valid configuration snippet (AFAIK) but it won’t do what you
probably expect. It defines two upstream servers, one running on a unix
socket and one on TCP. The protocol that Nginx speaks to them depends on
whether you use proxy_pass or fastcgi_pass. AFAIK you cannot balance
between a FastCGI backend and a HTTP backend.

The first one is a FASTCGI + the second is a backend PHP proxy that I want to
use so that if the main one is overloading the server, the backend can apply
help reduce the load.

Is there any way this can be done ? I’m specifically also asking how I can
configure the FASTCGI / mod_Proxy parts.

Is my only option to run two NGINX- one for front end ( redirecting to a local
nginx and a backend server as http proxy) , and the other doing fastcgi work ?

You could also run the remote PHP over FastCGI and just use FastCGI
everywhere. I think that php-fcgi -b 10.0.0.200:8080 or something
similar will do the job (but I’m sure Mike will step in and tell you how
to use php-fpm in such a setup ;))

Best regards,
Grzegorz N.