HTTP/2 directives

http2 directive

http, server; available from 1.25.1, default off. Enables client HTTP/2 with the module present.

Formal Syntax & Structure

nginx syntaxnginx
http2 on | off;

Parameters & Attributes

NameTypeDescription
stateon | offEnable downstream HTTP/2; standalone directive requires 1.25.1+. TLS listeners also need ALPN.

Working Example

Example Snippetnginx
http2 on;
Nginx Reference