FastCGI in various servers

Benjamin Pineau ben at
Thu Dec 16 01:34:47 MSK 2010


On 15/12/2010 22:00, Antonio wrote:
> I have a question about fastcgi. If I use 5 web server with fastcgi, with a script that works with session variables, if
> it balances the request to another different server. How to access the session variables? As will be stored in another
> /tmp/SESSION_XXX (other machine).

You have either to store your sessions on a common shared
backend (moderns web scripting languages allows storing
sessions in memcached or database, but you can also use NFS
for instance, ..), or just reduce the odd to loose the
sessions (for instance by using the ip_hash option for the
upstream backend, so clients will stick to the same server
unless nginx detects this servers isn't available anymore).

> I can use in nginx fastcgi servers located on another machine, some configuration examples?. Thanks.

Maybe there ?

More information about the nginx mailing list