File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
roles/wordpress-setup/templates Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ server {
196196server {
197197 listen [::]:80;
198198 listen 80;
199- server_name {{ site_hosts | union(multisite_subdomains_wildcards) | join(' ') }};
199+ server_name {{ site_hosts_canonical | union(multisite_subdomains_wildcards) | join(' ') }};
200200
201201 {{ self.acme_challenge() -}}
202202
@@ -216,8 +216,12 @@ server {
216216{% endif %}
217217{% for host in item .value .site_hosts if host .redirects | default ([]) %}
218218server {
219- listen {{ ssl_enabled | ternary('[::] :443 ssl http2', '[::] :80') }};
220- listen {{ ssl_enabled | ternary('443 ssl http2', '80') }};
219+ {% if ssl_enabled -%}
220+ listen [::]:443 ssl http2;
221+ listen 443 ssl http2;
222+ {% endif -%}
223+ listen [::]:80;
224+ listen 80;
221225 server_name {{ host.redirects | join(' ') }};
222226
223227 {{ self.https() -}}
@@ -226,7 +230,9 @@ server {
226230
227231 {{ self.includes_d() -}}
228232
229- return 301 $scheme://{{ host.canonical }}$request_uri;
233+ location / {
234+ return 301 {{ ssl_enabled | ternary('https', 'http') }}://{{ host.canonical }}$request_uri;
235+ }
230236}
231237{% endfor %}
232238{% endblock %}
You can’t perform that action at this time.
0 commit comments