# HG changeset patch # User Igor Sysoev # Date 1224861131 0 # Node ID 231b52f8adc0091bc257b44680a16f60e1c4a869 # Parent ec97eb9a80386b848d683630d06c1c21b0d5bbc3 fix case when URL has no port, but has ":" in URI part, the bug has been introduced in r2204 diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -264,7 +264,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx port = ngx_strlchr(host, last, ':'); - uri = ngx_strlchr(port ? port : host, last, '/'); + uri = ngx_strlchr(host, last, '/'); if (uri) { if (u->listen || !u->uri_part) { @@ -276,6 +276,10 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx u->uri.data = uri; last = uri; + + if (uri < port) { + port = NULL; + } } if (port) {