Let users define the target https redirect variable (#203)

Fixes #153
This commit is contained in:
Alessandro Fael Garcia 2019-12-06 20:51:11 -08:00 committed by GitHub
parent 8baa94e736
commit 905d6c7531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ nginx_http_template:
location: /var/log/nginx/error.log location: /var/log/nginx/error.log
level: warn level: warn
root: /usr/share/nginx/html root: /usr/share/nginx/html
https_redirect: false #https_redirect: $host
autoindex: false autoindex: false
auth_basic: null auth_basic: null
auth_basic_user_file: null auth_basic_user_file: null

View File

@ -142,7 +142,7 @@ server {
root {{ item.value.servers[server].root }}; root {{ item.value.servers[server].root }};
{% endif %} {% endif %}
{% if item.value.servers[server].https_redirect is defined and item.value.servers[server].https_redirect %} {% if item.value.servers[server].https_redirect is defined and item.value.servers[server].https_redirect %}
return 301 https://{% if item.value.servers[server].server_name == "_" %}$host{% else %}{{ item.value.servers[server].server_name }}{% endif %}$request_uri; return 301 https://{{ item.value.servers[server].https_redirect }}$request_uri;
{% endif %} {% endif %}
{% if item.value.servers[server].autoindex is defined and item.value.servers[server].autoindex %} {% if item.value.servers[server].autoindex is defined and item.value.servers[server].autoindex %}
autoindex on; autoindex on;