aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-11-29 20:39:32 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-11-29 20:39:32 +0000
commita1b92a96598ff9d54cdf5805c3e74ee266d349a4 (patch)
tree4eae87ab2732fd6cd11f22f0fae4220b71e675e5 /src/http/ngx_http_core_module.c
parent9f34ebe23176b69359d327c291bf8aff2fcafaf4 (diff)
downloadnginx-a1b92a96598ff9d54cdf5805c3e74ee266d349a4.tar.gz
nginx-a1b92a96598ff9d54cdf5805c3e74ee266d349a4.zip
fix server_name regex named captures given by "?P<...>"
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index e6b1162a0..b88df336b 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3507,16 +3507,16 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
sn->server = cscf;
sn->name = value[i];
- ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
-
if (value[i].data[0] != '~') {
+ ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
continue;
}
#if (NGX_PCRE)
{
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
+ u_char *p;
+ ngx_regex_compile_t rc;
+ u_char errstr[NGX_MAX_CONF_ERRSTR];
if (value[i].len == 1) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -3533,6 +3533,13 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
rc.err.len = NGX_MAX_CONF_ERRSTR;
rc.err.data = errstr;
+ for (p = value[i].data; p < value[i].data + value[i].len; p++) {
+ if (*p >= 'A' && *p <= 'Z') {
+ rc.options = NGX_REGEX_CASELESS;
+ break;
+ }
+ }
+
sn->regex = ngx_http_regex_compile(cf, &rc);
if (sn->regex == NULL) {
return NGX_CONF_ERROR;