What does [::] mean in my nginx config file

Nginx

Nginx Problem Overview


I was looking at my nginx config file I noticed two this.

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    index index.html;
}

I understand this part listen 80 default_server; it tells nginx to listen on port 80 and set that as the "default_server" but I do not understand the second line.

listen [::]:80 default_server;

It appears I am setting the default server again on port 80 but I do not really understand the [::] part of it at all.

Can someone explain to me what this configuration does?

Nginx Solutions


Solution 1 - Nginx

It is for the IPv6 configs

from the nginx docs

IPv6 addresses (0.7.36) are specified in square brackets:

listen [::]:8000;
listen [::1];

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSubtubesView Question on Stackoverflow
Solution 1 - NginxCamron_GodboutView Answer on Stackoverflow