0

My nginx config looks like this:

server {
    listen 80 default_server;
    index index.html;
}

Must I add listen [::]:80 default_server; or is it not mandatory?

So the config will end up looking like this:

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

    index index.html;
}

I found that it is for IPv6 configs, but I am not sure, I understand what does that mean in this context/config file. Could you elaborate more? Sorry, for noob question.

En0w1na
  • 1
  • 1
  • I think the linked post above covers everything you have asked. Please add a comment if you think something is still missing. – Michael Hampton Feb 14 '21 at 02:11
  • Does it mean that if I do not have listen [::]:80 default_server; users with IPv6 will not be able to access my server? Or am I understanding this wrongly – En0w1na Feb 14 '21 at 02:16
  • That's correct; if you don't use the directive, users cannot visit your site with IPv6. – Michael Hampton Feb 14 '21 at 02:27
  • I know you said this clearly, but I am a bit shocked right now. My website gets around 30k unique visitors daily. My nginx config did not have `listen [::]:80 default_server;`. So this means: 1. I lost traffic, because people with IPv6 were not able to visit my website? 2. What happened for such users? Did they see a blank page when they visited with IPv6 or how they experienced this? – En0w1na Feb 14 '21 at 02:34
  • They will fall back to IPv4, but as discussed in the linked post, they may have a slower or less reliable experience (not because of you, but because of large scale NAT at their ISP). – Michael Hampton Feb 14 '21 at 03:17
  • thank you for clarifying. Btw is there a way I can hire you to optimize my server settings? I can see to DM you here. – En0w1na Feb 14 '21 at 03:28
  • If you don't have AAAA record defined for your website in DNS, you haven't lost anything. – Tero Kilkanen Feb 14 '21 at 07:29
  • @TeroKilkanen thanks you for information. But I dont understand, why would one need to define AAAA record, what is the benefit, if everything works without it? Sound like don't put `listen [::]:80 default_server; ` don't define AAAA record and everything is okay. Probably I am missing something, but don't understand what. – En0w1na Feb 15 '21 at 08:34

0 Answers0