comparison src/http/ngx_http_upstream.c @ 4152:65c1c241d70e

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 27 Sep 2011 11:18:51 +0000
parents 3549db8ceaf2
children 2b5151a2300b
comparison
equal deleted inserted replaced
4151:3549db8ceaf2 4152:65c1c241d70e
4333 && uscfp[i]->default_port != u->default_port) 4333 && uscfp[i]->default_port != u->default_port)
4334 { 4334 {
4335 continue; 4335 continue;
4336 } 4336 }
4337 4337
4338 if (flags & NGX_HTTP_UPSTREAM_CREATE) {
4339 uscfp[i]->flags = flags;
4340 }
4341
4338 return uscfp[i]; 4342 return uscfp[i];
4339 } 4343 }
4340 4344
4341 uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t)); 4345 uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t));
4342 if (uscf == NULL) { 4346 if (uscf == NULL) {