From 0c4ccbea23813a50132df511d4445bc1686dbc2f Mon Sep 17 00:00:00 2001 From: Vladimir Homutov Date: Fri, 15 Jun 2018 11:46:14 +0300 Subject: Upstream: ngx_http_upstream_random module. The module implements random load-balancing algorithm with optional second choice. In the latter case, the best of two servers is chosen, accounting number of connections and server weight. Example: upstream u { random [two [least_conn]]; server 127.0.0.1:8080; server 127.0.0.1:8081; server 127.0.0.1:8082; server 127.0.0.1:8083; } --- auto/modules | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'auto/modules') diff --git a/auto/modules b/auto/modules index 73a9bae9b..09bfcb08d 100644 --- a/auto/modules +++ b/auto/modules @@ -878,6 +878,17 @@ if [ $HTTP = YES ]; then . auto/module fi + if [ $HTTP_UPSTREAM_RANDOM = YES ]; then + ngx_module_name=ngx_http_upstream_random_module + ngx_module_incs= + ngx_module_deps= + ngx_module_srcs=src/http/modules/ngx_http_upstream_random_module.c + ngx_module_libs= + ngx_module_link=$HTTP_UPSTREAM_RANDOM + + . auto/module + fi + if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then ngx_module_name=ngx_http_upstream_keepalive_module ngx_module_incs= @@ -1143,6 +1154,16 @@ if [ $STREAM != NO ]; then . auto/module fi + if [ $STREAM_UPSTREAM_RANDOM = YES ]; then + ngx_module_name=ngx_stream_upstream_random_module + ngx_module_deps= + ngx_module_srcs=src/stream/ngx_stream_upstream_random_module.c + ngx_module_libs= + ngx_module_link=$STREAM_UPSTREAM_RANDOM + + . auto/module + fi + if [ $STREAM_UPSTREAM_ZONE = YES ]; then have=NGX_STREAM_UPSTREAM_ZONE . auto/have -- cgit