Enable HTTP2 in one of several name-based servers

Valentin V. Bartenev vbart at nginx.com
Thu Jun 23 09:29:19 UTC 2016


On Thursday 23 June 2016 04:35:45 itpp2012 wrote:
> Valentin V. Bartenev Wrote:
> -------------------------------------------------------
> > > Is it possible to enable http2 in only one of several name-based
> > servers?
> > > 
> > [..]
> > 
> > No, it's not possible.
> 
> Would it be a big (api) change to add a server block session flag?
> 
> ngx_http_v2_init(ngx_event_t *rev)
> ...
> if ( h2scf.no_http2 ) { /* example server block flag */
>     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http2 disabled in server
> context");
>             ngx_http_close_connection(c);
>             return;
>         }
> ...
>     c->log->action = "processing HTTP/2 connection";
> 

What effect do you expect?  Since clients are able to request different hosts 
using single HTTP/2 connection, closing the connection in one server block 
will break everything.

  wbr, Valentin V. Bartenev



More information about the nginx mailing list