diff --git a/roles/wordpress-setup/defaults/main.yml b/roles/wordpress-setup/defaults/main.yml index e8e6d91959..77140141d4 100644 --- a/roles/wordpress-setup/defaults/main.yml +++ b/roles/wordpress-setup/defaults/main.yml @@ -7,6 +7,9 @@ nginx_sites_confs: - src: ssl.no-default.conf.j2 enabled: false +nginx_http2_enabled: true +nginx_http3_enabled: false + # HSTS defaults nginx_hsts_max_age: 31536000 nginx_hsts_include_subdomains: false diff --git a/roles/wordpress-setup/templates/wordpress-site.conf.j2 b/roles/wordpress-setup/templates/wordpress-site.conf.j2 index b436c857d4..95b406439a 100644 --- a/roles/wordpress-setup/templates/wordpress-site.conf.j2 +++ b/roles/wordpress-setup/templates/wordpress-site.conf.j2 @@ -4,8 +4,10 @@ server { {% block server_id -%} - listen {{ ssl_enabled | ternary('[::]:443 ssl http2', '[::]:80') }}; - listen {{ ssl_enabled | ternary('443 ssl http2', '80') }}; + listen {{ ssl_enabled | ternary('[::]:443 ssl', '[::]:80') }}; + listen {{ ssl_enabled | ternary('443 ssl', '80') }}; + http2 {{ nginx_http2_enabled | default(false) | ternary('on', 'off') }}; + http3 {{ nginx_http3_enabled | default(false) | ternary('on', 'off') }}; server_name {{ site_hosts_canonical | union(multisite_subdomains_wildcards) | join(' ') }}; {% endblock %} @@ -290,11 +292,13 @@ server { {% for host in item.value.site_hosts if host.redirects | default([]) %} server { {% if ssl_enabled -%} - listen [::]:443 ssl http2; - listen 443 ssl http2; + listen [::]:443 ssl; + listen 443 ssl; {% endif -%} listen [::]:80; listen 80; + http2 {{ nginx_http2_enabled | default(false) | ternary('on', 'off') }}; + http3 {{ nginx_http3_enabled | default(false) | ternary('on', 'off') }}; server_name {{ host.redirects | join(' ') }}; {{ self.https() -}}