From 0ded5a85284ae791976a6f619e48fedba701a84d Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 7 Jan 2026 11:44:17 +0700 Subject: [PATCH] Use http2 directive --- templates/nginx.conf.j2 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index ba66f0b..af49357 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -47,12 +47,12 @@ server { {% if nginx_listen443 is defined %} {{ nginx_listen443 }} {% else %} - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl; + listen [::]:443 ssl; {% if proxy_protocol is defined %} - listen 442 ssl http2 proxy_protocol; - listen [::]:442 ssl http2 proxy_protocol; + listen 442 ssl proxy_protocol; + listen [::]:442 ssl proxy_protocol; real_ip_header proxy_protocol; {% for ip in proxy_protocol.ipv4 %} set_real_ip_from {{ ip }}; @@ -64,6 +64,7 @@ server { port_in_redirect off; {% endif %} {% endif %} + http2 on; server_name {% if redirect_to_first is not defined or not redirect_to_first %}{{ domains | join(' ') }}{% else %}{{ domains[0] }}{% endif %}; {% if ssl_certificate is defined -%} @@ -93,12 +94,12 @@ server { {% if nginx_listen443 is defined -%} {{ nginx_listen443 }} {% else %} - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl; + listen [::]:443 ssl; {% if proxy_protocol is defined %} - listen 442 ssl http2 proxy_protocol; - listen [::]:442 ssl http2 proxy_protocol; + listen 442 ssl proxy_protocol; + listen [::]:442 ssl proxy_protocol; real_ip_header proxy_protocol; {% for ip in proxy_protocol.ipv4 %} set_real_ip_from {{ ip }}; @@ -110,6 +111,7 @@ server { port_in_redirect off; {% endif %} {% endif %} + http2 on; server_name {{ domains[1:] | join(' ') }}; {% if ssl_certificate is defined %}