| # This file describes how to use upstream blocks. |
| An upstream block allows you to set a list of upstream locations for both |
| proxy_pass and fastcgi_pass directives. |
| Examples of upstream blocks: |
| # PHP listening on the same server |
| # ip_hash ensures the same backend is used for client reconnects. |
| # This assumes we have multiple PHP listeners on different known ports. |
| # In addition to listening on ports, we can listen to unix sockets. |
| server unix:/tmp/php-cgi.socket; |
| # Multiple backend Apache instances on separate servers |
| # Adding a weight alters the chance the upstream server will be used. |
| server apache1.domain.com weight 5; |
| server apache2.domain.com; |
| server apache3.domain.com; |
| # Adding 'down' keeps the upstream from being used. Useful for downtime management. |
| server apache4.domain.com down; |
| server apache5.domain.com; |
| Using an upstream location: |
| # Passing PHP to upstream |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| # Passing all requests for /cgi-bin/* to Apache upstreams. |
| For more information see http://wiki.nginx.org/HttpUpstreamModule |