Use http2 directive

This commit is contained in:
nemunaire 2026-01-07 11:44:17 +07:00
commit 0ded5a8528

View file

@ -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 %}