h5bp / server-configs-nginx

Nginx HTTP server boilerplate configs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no-default only listens for IPv6

tostr7191 opened this issue · comments

I was just trying to build an ansible role with this configuration as the basis. Is it on purpose that the config only listens on :::80 but not on :80?

Specifically in ./sites-available/no-default

  listen [::]:80 default_server deferred;

should be

  listen 80 default_server deferred;
  listen [::]:80 default_server deferred;

in my opinion. But I am not very familiar with the config or nginx.
Thanks & best
tostrio

The default server should be changed to:

listen [::]:80 default_server ipv6only=off deferred;

Then all further listen [::]:80 will automatically listen on both.

Thanks @Rowno, I did not realize it was possible in one line. One thing I noticed with your solution, it does not show seperately in netstat or ss, but as a combined line [::]:80.

I created a pull request here: #179