summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-09-27 11:18:51 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-09-27 11:18:51 +0000
commit886c6295eeaa850d479bdf4590751cfbfb32814d (patch)
treeb107499c60317871795b356837e5a03d37ee446d
parentb16918ed08b9f1155220a980ee6e133d31f2b61a (diff)
downloadnginx-886c6295eeaa850d479bdf4590751cfbfb32814d.tar.gz
nginx-886c6295eeaa850d479bdf4590751cfbfb32814d.tar.bz2
Better handling of late upstream creation.
Configuration with duplicate upstream blocks defined after first use, i.e. like server { ... location / { proxy_pass http://backend; } } upstream backend { ... } upstream backend { ... } now correctly results in "duplicate upstream" error. Additionally, upstream blocks defined after first use now handle various server directive parameters ("weight", "max_fails", etc.). Previously configuration like server { ... location / { proxy_pass http://backend; } } upstream backend { server 127.0.0.1 max_fails=5; } incorrectly resulted in "invalid parameter "max_fails=5"" error.
-rw-r--r--src/http/ngx_http_upstream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 703b8ff98..7e06b677e 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -4335,6 +4335,10 @@ ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
continue;
}
+ if (flags & NGX_HTTP_UPSTREAM_CREATE) {
+ uscfp[i]->flags = flags;
+ }
+
return uscfp[i];
}