how to enable http2 for two server hosted on the same IP

A. Schulze sca at andreasschulze.de
Thu Jan 4 15:53:48 UTC 2018


meteor8488:

> Hi All,
>
> If I use
>
> server {
> 	listen       443  accept_filter=dataready ssl http2;
> 	}
> server {
> 	listen  443 http2 sndbuf=512k;
> 	}
>
> I'll get error
>  duplicate listen options for 0.0.0.0:443
>
> I know it's caused by http2 in server 2.

probably you're wrong. The error is to specify sndbuf in the second server.

from https://nginx.org/r/listen:
     The listen directive can have several additional parameters  
specific to socket-related system calls.
     These parameters can be specified in any listen directive, but  
only once for a given address:port pair.

"but only once for a given address:port pair" is the point!

multiple options: ssl, http2, spdy, proxy_protocol
single options: setfib, fastopen, backlog, ...

Andreas




More information about the nginx mailing list