# HG changeset patch # User Yaroslav Zhuravlev # Date 1423139148 -10800 # Node ID ea73cd9d4cdb3dcd67e6f3c6251414dd65bd916d # Parent 4569719f4247130bcdd913f71335faa94fefb7e1 Changed stream_upstream examples. diff --git a/xml/en/docs/stream/ngx_stream_upstream_module.xml b/xml/en/docs/stream/ngx_stream_upstream_module.xml --- a/xml/en/docs/stream/ngx_stream_upstream_module.xml +++ b/xml/en/docs/stream/ngx_stream_upstream_module.xml @@ -1,7 +1,6 @@ @@ -10,7 +9,7 @@ + rev="3">
@@ -35,18 +34,17 @@ This module is available as part of our -stream { - upstream backend { - hash $remote_addr consistent; - server backend1.example.com:8000; - server backend2.example.com:8000; - server backend3.example.com:8001; - } +upstream backend { + hash $remote_addr consistent; - server { - listen 9000; - proxy_pass backend; - } + server backend1.example.com:12345 weight=5; + server 127.0.0.1:12345 max_fails=3 fail_timeout=30s; + server unix:/tmp/backend3; +} + +server { + listen 12346; + proxy_pass backend; } @@ -72,11 +70,11 @@ can be mixed. Example: upstream backend { - server backend1.example.com:8080 weight=5; - server 127.0.0.1:8080 max_fails=3 fail_timeout=30s; + server backend1.example.com:12345 weight=5; + server 127.0.0.1:12345 max_fails=3 fail_timeout=30s; server unix:/tmp/backend3; - server backup1.example.com:8080 backup; + server backup1.example.com:12345 backup; } @@ -85,7 +83,7 @@ upstream backend { By default, connections are distributed between the servers using a weighted round-robin balancing method. In the above example, each 7 connections will be distributed as follows: -5 connections go to backend1.example.com +5 connections go to backend1.example.com:12345 and one connection to each of the second and third servers. If an error occurs during communication with a server, the connection will be passed to the next server, and so on until all of the functioning