Nginx not listening on ipv6

Hi everyone, I have hardtime setting up ipv6 on our gitlab instance following the docs here : NGINX settings | GitLab

We have added this to the gitlab.rb file :

# Listen on all IPv4 and IPv6 addresses
nginx['listen_addresses'] = ["0.0.0.0", "[::]"]
registry_nginx['listen_addresses'] = ['*', '[::]']
mattermost_nginx['listen_addresses'] = ['*', '[::]']
pages_nginx['listen_addresses'] = ['*', '[::]']

However after restarting the server using gitlab-ctl restart the server does not reply on ipv6, any help ?

Thanks in advance !

Hi Orso!

Have you tried checking the firewall setting on the server to allow ipv6 connections?

Hi, thanks for your reply.

the firewall is not located on the machine itself and ipv6 is allowed on it, other webservers are working with the same configuration.

I think that nginx is not listening to ipv6

Hi,

I made more tests and even telnet does not reply when try to connect to port 443 or 80 on IPv6 from the machine itself:

# telnet <ipv6 address of the server> 443
Trying <ipv6 address of the server>...
telnet: connect to address <ipv6 address of the server>: Connection refused

Running same test on ipv4 :

# telnet <ipv4> 443
Trying <ipv4>...
Connected to <ipv4>.
Escape character is '^]'.

Also trying to listening connections with netstat does not show any ipv6 :

# netstat -avlpt|grep nginx
tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN      15907/nginx: master 
tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      15907/nginx: master 
tcp        0      0 0.0.0.0:http            0.0.0.0:*               LISTEN      15907/nginx: master 
tcp        0      0 localhost:8060          localhost:43114         ESTABLISHED 15910/nginx: worker
#netstat -6avlpt -> no output

How can we enable ipv6 since the ipv6 settings on gitlab.rb doesnt seems to be taken into account ?

Thanks in advance for any help,

Denis

Check the config of your Linux machine, since it could be that ipv6 is disabled. What distro are you using?

I have no special config in gitlab.rb and mine listens on ipv6. You can use ifconfig to check if your eth0 or whatever interface has an ipv6 address. This will also verify if it’s enabled or disabled, since if ipv6 is disabled then there will be no ipv6 address at interface level.

Hi thanks for your message.

we are using Centos 7.

Ipv6 is enabled and running on the machine I can connect using ssh on ipv6, also trying telnet is working on port 22 :

# telnet  <ipv6> 22
Trying <ipv6>...
Connected to <ipv6>.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.4

There’s one difference between your config or mine, although not sure if it will be because of this but you can try:

nginx['listen_addresses'] = ['x.x.x.x', '[::]']

I have put x.x.x.x where my IP address was, since I don’t have it listening directly on 0.0.0.0 but you will notice I have single quotes, and yours has double quotes. Try changing this and then run:

gitlab-ctl reconfigure

and then:

gitlab-ctl restart

see if it helps.

Hi,

thanks for your help, changing the quotes made everything works as expected.

I should have tested this by myself but I think I copied the quotes from the docs : NGINX settings | GitLab

Thanks again for your time !

Denis

1 Like

Glad it’s all sorted and working smile.png

1 Like