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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Andrzej Walas
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
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

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

A. Schulze

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
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

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

Andrzej Walas
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
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx