Does url resolve support ipv6?

I have several upstream servers, which are configured like this:

upstream backend {
ip_hash;
server backend1.example.com;
server backend2.example.com;
server backend3.example.com down;
server backend4.example.com;
}

each server has ONLY IPv6 address. But seems nginx can’t parse it to
that address, and report an error like this “[error] host not found”.

Is this a bug or meant not to be supported yet?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,177146,177146#msg-177146

I check the code and find it uses “ngx_parse_url” and this function
first try to find whether there is a “[” in the first character to judge
whether use ipv4 or ipv6 parse. This is clearly wrong because you can’t
tell the URL’s ip address type.

I’d like to write a patch to improve this.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,177146,177149#msg-177149

Hi,

i had a similar problem with the proxy module and, i think it was
Igor himself who told me, that there is currently no ipv6 support
for the proxy module. So it might be the same issue here.

HTH,
Sven

Am 21.02.2011 08:46, schrieb speedfirst:

Hello!

On Mon, Feb 21, 2011 at 02:46:30AM -0500, speedfirst wrote:

each server has ONLY IPv6 address. But seems nginx can’t parse it to
that address, and report an error like this “[error] host not found”.

Is this a bug or meant not to be supported yet?

IPv6 currently only supported in listen directive. That is, there
is more than one issue when trying to proxy to IPv6 addresses.

Maxim D.

that function call is blocking isnt it?

If I only concern about the proxy of http upstream and mail upstream, is
it alright to change the implementation of “ngx_parse_url”, which
replace “gethostbyname” to “getaddrinfo”? Is there other issues that I
need to pay attention?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,177146,177392#msg-177392

Hi,

that function call is blocking isnt it?

So is gethostbyname().

Best regards,
Piotr S. < [email protected] >

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs