Add support for enabling an http to https redirects (#82)

* Add support for enabling an http to https redirects

* Remove extra curly brace

* Update default.conf.j2

Remove another extra curly brace

* Add redirect variable to defaults and readme
This commit is contained in:
Daniel Mills 2019-01-03 14:14:25 -08:00 committed by Alessandro Fael Garcia
parent fe3caad174
commit bd09ecd85e
3 changed files with 5 additions and 0 deletions

View File

@ -328,6 +328,7 @@ nginx_http_template:
port: 8081
server_name: localhost
error_page: /usr/share/nginx/html
redirect: false
autoindex: false
ssl:
cert: ssl/default.crt

View File

@ -161,6 +161,7 @@ nginx_http_template:
port: 8081
server_name: localhost
error_page: /usr/share/nginx/html
redirect: false
autoindex: false
ssl:
cert: ssl/default.crt

View File

@ -28,6 +28,9 @@ server {
{% if item.value.autoindex is defined and item.value.autoindex %}
autoindex on;
{% endif %}
{% if item.value.redirect is defined and item.value.redirect %}
return 301 https://{{ item.value.server_name }}$request_uri;
{% endif%}
{% if item.value.load_balancer is defined %}
{% for location in item.value.load_balancer.locations %}
location {{ item.value.load_balancer.locations[location].location }} {