5
# This file describes how to use upstream blocks.
8
An upstream block allows you to set a list of upstream locations for both
9
proxy_pass and fastcgi_pass directives.
11
Examples of upstream blocks:
13
# PHP listening on the same server
15
# ip_hash ensures the same backend is used for client reconnects.
17
# This assumes we have multiple PHP listeners on different known ports.
18
server 127.0.0.1:9000;
19
server 127.0.0.1:9001;
20
server 127.0.0.1:9002;
21
server 127.0.0.1:9003;
22
# In addition to listening on ports, we can listen to unix sockets.
23
server unix:/tmp/php-cgi.socket;
26
# Multiple backend Apache instances on separate servers
28
# Adding a weight alters the chance the upstream server will be used.
29
server apache1.domain.com weight 5;
30
server apache2.domain.com;
31
server apache3.domain.com;
32
# Adding 'down' keeps the upstream from being used. Useful for downtime management.
33
server apache4.domain.com down;
34
server apache5.domain.com;
37
Using an upstream location:
39
# Passing PHP to upstream
41
fastcgi_split_path_info ^(.+\.php)(/.+)$;
42
include fastcgi_params;
46
# Passing all requests for /cgi-bin/* to Apache upstreams.
51
For more information see http://wiki.nginx.org/HttpUpstreamModule