Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 279c7c2

Browse files
committed
Updating-wordpress-vhost-template-PR-2.x
1 parent 24f6695 commit 279c7c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roles/debian/nginx/templates/vhosts.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ upstream {{ upstream.name }} {
88
}
99
{% endfor %}
1010

11+
{% set primary_domain = domain.server_name.split(' ')[0] %}
12+
1113
{% for server in domain.servers %}
1214
server {
1315
listen {{ server.port }}{% if domain.is_default is defined and domain.is_default %} default_server{% endif %}{% if server.ssl %} ssl{% endif %};
1416
server_name {{ domain.server_name }};
1517
{% if server.https_redirect is defined and server.https_redirect %}
16-
rewrite ^ https://{{ domain.server_name }}$request_uri? permanent;
18+
rewrite ^ https://{{ primary_domain }}$request_uri? permanent;
1719
{% endif %}
1820
{% if server.custom_directives is defined %}
1921
{% for directive in server.custom_directives %}

0 commit comments

Comments
 (0)