Welcome! Log In Create A New Profile

Advanced

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

Posted by meteor8488 
meteor8488
how to enable http2 for two server hosted on the same IP
January 04, 2018 03:30PM
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. But how can I enable http2 on two
servers?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,277991,277991#msg-277991

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Thanks for reply.

Server 1 is for php and server 2 is for static files.
I want to enable sndbuf on server 2. Then how can I do that?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,277991,278023#msg-278023

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login