comparison src/http/ngx_http_upstream.c @ 4349:e04fdb54dd71 stable-1.0

Merge of r4153: 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, 13 Dec 2011 18:34:34 +0000
parents 6af89b1b16e8
children 4919fb357a5d
comparison
equal deleted inserted replaced
4348:6af89b1b16e8 4349:e04fdb54dd71
4278 && uscfp[i]->default_port != u->default_port) 4278 && uscfp[i]->default_port != u->default_port)
4279 { 4279 {
4280 continue; 4280 continue;
4281 } 4281 }
4282 4282
4283 if (flags & NGX_HTTP_UPSTREAM_CREATE) {
4284 uscfp[i]->flags = flags;
4285 }
4286
4283 return uscfp[i]; 4287 return uscfp[i];
4284 } 4288 }
4285 4289
4286 uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t)); 4290 uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t));
4287 if (uscf == NULL) { 4291 if (uscf == NULL) {