Welcome! Log In Create A New Profile

Advanced

Re: IPv6 support

April 22, 2009 02:27PM
On Wed, Apr 22, 2009 at 02:12:15PM -0400, r wrote:

> Hello,
>
> Thanks for the quick answer.
>
> Well, I'm sure nothing is running on those port (except the same nginx on the IPv4 address with a "listen 80" entry). But you managed to make me find the real bug!
>
> I made two configuration files with the same entries but each one has different listen entries (so i have a nginx.conf-ipv4 and nginx.conf-ipv6).
>
> # nginx -c nginx.conf-ipv4
> # netstat -punta | grep :443
> tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 9810/nginx.conf-ipv4
> # nginx -c nginx.conf-ipv6
> # netstat -punta | grep :443
> tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 9810/nginx.conf-ipv4
> # tail /var/log/nginx/error.log
> ...
> 2009/04/22 19:54:51 9715#0: bind() to [::]:443 failed (98: )
> 2009/04/22 19:54:51 9715#0: still could not bind()
> # (i kill nginx both nginx processes)
> # netstat -punta | grep :443
> (returns nothing)
> # nginx -c nginx.conf-ipv6
> # netstat -punta | grep :443
> tcp6 0 0 :::443 :::* LISTEN 9765/nginx.conf-ipv6
> # nginx -c nginx.conf-ipv4
> # netstat -punta | grep :443
> tcp6 0 0 :::443 :::* LISTEN 9765/nginx.conf-ipv6
> # tail /var/log/nginx/error.log
> ...
> 2009/04/22 20:03:14 10207#0: bind() to 94.23.8.133:443 failed (98: )
> 2009/04/22 20:03:14 10207#0: still could not bind()
>
> So, it works, but impossible to have two listen entries with both ipv4 and ipv6 (like the one in the post you made in february).
>
> I'm running Debian GNU/Linux 5.0 (lenny).

It seems in Linux [::]:443 listens on both IPv6 and IPv4 addresses.
You may test this by making a request to IPv4 address, it should work.

If you want to set two listen sockets, then you need

listen [::]:443 default ipv6only=on;
listen [::]:80;


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

IPv6 support

r April 21, 2009 07:17PM

Re: IPv6 support

Igor Sysoev April 22, 2009 01:46AM

Re: IPv6 support

r April 22, 2009 02:12PM

Re: IPv6 support

Igor Sysoev April 22, 2009 02:27PM

Re: IPv6 support

r April 22, 2009 03:23PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready