# HG changeset patch # User Igor Sysoev # Date 1237478860 0 # Node ID 1fb5e7e05a4eb28bf7ac622f6b671e6043f4a686 # Parent 2068bdecc876b1c846be8e1eba0b6f798c07890c always run regex in server_name to get captures diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -1395,7 +1395,12 @@ ngx_http_optimize_servers(ngx_conf_t *cf name = addr[a].names.elts; for (s = 0; s < addr[a].names.nelts; s++) { - if (addr[a].core_srv_conf == name[s].core_srv_conf) { + if (addr[a].core_srv_conf == name[s].core_srv_conf +#if (NGX_PCRE) + && name[s].captures == 0 +#endif + ) + { continue; } @@ -1806,7 +1811,11 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_h && (addr[i].wc_head == NULL || addr[i].wc_head->hash.buckets == NULL) && (addr[i].wc_tail == NULL - || addr[i].wc_tail->hash.buckets == NULL)) + || addr[i].wc_tail->hash.buckets == NULL) +#if (NGX_PCRE) + && addr[i].nregex == 0 +#endif + ) { continue; }