I found the issue. It checks for "ipv6=" token in #if (NGX_HAVE_INET6) block. so if NGX_HAVE_INET6 is not enabled, it treats it as a host instead of ignoring it.
#if (NGX_HAVE_INET6)
if (ngx_strncmp(names[i].data, "ipv6=", 5) == 0) {
if (ngx_strcmp(&names[i].data[5], "on") == 0) {
r->ipv6 = 1;
} else if (ngx_strcmp(&names[i].data[5], "off") == 0) {
r->ipv6 = 0;
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid parameter: %V", &names[i]);
return NULL;
}
continue;
}
#endif
should have been:
if (ngx_strncmp(names[i].data, "ipv6=", 5) == 0) {
#if (NGX_HAVE_INET6)
if (ngx_strcmp(&names[i].data[5], "on") == 0) {
r->ipv6 = 1;
} else if (ngx_strcmp(&names[i].data[5], "off") == 0) {
r->ipv6 = 0;
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid parameter: %V", &names[i]);
return NULL;
}
#endif
continue;
}
On Thursday, 19 May 2016 17:42:08 UTC-4, Warren Strange wrote:
The parser seems rather fragile (sensitive to white space, etc.), so I can only suggest triple checking the syntax.
On Thursday, May 19, 2016 at 2:52:19 PM UTC-6, RJoshi wrote:
If I use more than one resolver IP and use ipv6=off, it is treating "ipv6=off" as host and giving invalid host error.
On Friday, 13 May 2016 17:24:36 UTC-4, Warren Strange wrote:
OK - this is embarrassing, but I had a extra space on the resolver line:
resolver 8.8.8.8 ipv6 = off;
(note extra spaces.....)
Sigh....
On Friday, May 13, 2016 at 3:03:56 PM UTC-6, Warren Strange wrote:
Just to add..
I tried building with and without the --with-ipv6 option
Same error
On Friday, May 13, 2016 at 2:45:23 PM UTC-6, Warren Strange wrote:
I'm getting a really baffling error on nginx startup with openresty 1.9.7.4
This *used* to work, so I'm really scratching my head trying to figure out what I might have changed.
This is running in a Docker container. I have stripped down nginx.conf to a bare bones startup.
I have module configured
resolver 8.8.8.8 ipv6=off;
I get this error:
nginx: [emerg] host not found in resolver "ipv6=off"
If I comment out the resolver line, nginx comes up.
(I need the resolver for the OpenID connect module to work)
Thanks