Skip to content

Commit 905d6c7

Browse files
authored
Let users define the target https redirect variable (#203)
Fixes #153
1 parent 8baa94e commit 905d6c7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

defaults/main/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ nginx_http_template:
7575
location: /var/log/nginx/error.log
7676
level: warn
7777
root: /usr/share/nginx/html
78-
https_redirect: false
78+
#https_redirect: $host
7979
autoindex: false
8080
auth_basic: null
8181
auth_basic_user_file: null

templates/http/default.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ server {
142142
root {{ item.value.servers[server].root }};
143143
{% endif %}
144144
{% if item.value.servers[server].https_redirect is defined and item.value.servers[server].https_redirect %}
145-
return 301 https://{% if item.value.servers[server].server_name == "_" %}$host{% else %}{{ item.value.servers[server].server_name }}{% endif %}$request_uri;
145+
return 301 https://{{ item.value.servers[server].https_redirect }}$request_uri;
146146
{% endif %}
147147
{% if item.value.servers[server].autoindex is defined and item.value.servers[server].autoindex %}
148148
autoindex on;

0 commit comments

Comments
 (0)