Question

I'd like to have 1 web server (nginx) and 2 FastCGI instances of the same application as back-end. The idea is to forward requests to second one if the first one is down.

Apparently, I need to use upstream and fastcgi_next_upstream. But I could not find a working example of a nginx.conf file. Does anybody have such example?

Was it helpful?

Solution

http://wiki.nginx.org/HttpUpstreamModule
http://wiki.nginx.org/HttpFcgiModule

upstream  backend  {
    server   main_backend.server:port1;
    server   backup.server:port2    backup;
}

fastcgi_pass backend;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top