Maxim Dounin
June 01, 2019 10:50AM
Hello!

On Fri, May 31, 2019 at 03:15:18AM -0400, George wrote:

> I am trying to troubleshoot a duplicate listen options error that only
> happens on one server and not the other.
>
> From docs at http://nginx.org/en/docs/http/ngx_http_core_module.html backlog
> listen directive works for each ip:port pair so I should be able to set
> backlog directive on listen directive once on port 80 and once on port 443.
> But on one server I am not able to and can't see where the problem is coming
> from ? How shall I debug this ?

[...]

> --- not working ---
> Now on another Nginx 1.17.0 server I have 3 nginx vhosts but nginx restarts
> complain of duplicate listen options once I add vhost 3 and the error is
> related for vhost 2's listen directive
>
> nginx: [emerg] duplicate listen options for 0.0.0.0:443 in
> /path/to/vhost2/vhost
>
> vhost 1
> listen 80 default_server backlog=4095 reuseport fastopen=256;
>
> vhost 2
> listen 443 ssl http2 reuseport;
>
> vhost 3
> listen 443 ssl http2 backlog=4095;
>
> if i remove vhost 3 backlog=4095 directive there's no error though ?

Both

listen 443 ssl http2 reuseport;

and

listen 443 ssl http2 backlog=4095;

specify listening socket options, "reuseport" and "backlog=4095".
Socket options are only allowed to be specified once for a given
listening socket, and nginx complains as you try to specify time
twice. You have to specify both on a single "listen" directive.

> Now if I reverse it so backlog=4095 is set in vhost 2 and not vhost 3, then
> it works and nginx doesn't complain of errors ? No idea why that is the case
> or if it's a bug ?
>
> vhost 2
> listen 443 ssl http2 reuseport backlog=4095;
>
> vhost 3
> listen 443 ssl http2;

That's exactly how it is expected to work.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

duplicate listen options for backlog directive for ip:80 and ip:443 pairs ?

George May 31, 2019 03:15AM

Re: duplicate listen options for backlog directive for ip:80 and ip:443 pairs ?

Maxim Dounin June 01, 2019 10:50AM

Re: duplicate listen options for backlog directive for ip:80 and ip:443 pairs ?

George June 01, 2019 03:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
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