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?
Definition of Nginx FastCGI. Nginx fastcgi is used to translate requests of clients from an application server which was not handled the request of the client directly. Nginx FastCGI is the protocol that was based on the CGI which is earlier or it will contain the gateway of a common interface.
fail_timeout = time sets. the time during which the specified number of unsuccessful attempts to communicate with the server should happen to consider the server unavailable; and the period of time the server will be considered unavailable.
upstream defines a cluster that you can proxy requests to. It's commonly used for defining either a web server cluster for load balancing, or an app server cluster for routing / load balancing.
FastCGI is a fast, open, and secure Web server interface that solves the performance problems inherent in CGI, without introducing the overhead and complexity of proprietary APIs (Application Programming Interfaces).
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With