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:
parent
fe3caad174
commit
bd09ecd85e
@ -328,6 +328,7 @@ nginx_http_template:
|
|||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
redirect: false
|
||||||
autoindex: false
|
autoindex: false
|
||||||
ssl:
|
ssl:
|
||||||
cert: ssl/default.crt
|
cert: ssl/default.crt
|
||||||
|
@ -161,6 +161,7 @@ nginx_http_template:
|
|||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
|
redirect: false
|
||||||
autoindex: false
|
autoindex: false
|
||||||
ssl:
|
ssl:
|
||||||
cert: ssl/default.crt
|
cert: ssl/default.crt
|
||||||
|
@ -28,6 +28,9 @@ server {
|
|||||||
{% if item.value.autoindex is defined and item.value.autoindex %}
|
{% if item.value.autoindex is defined and item.value.autoindex %}
|
||||||
autoindex on;
|
autoindex on;
|
||||||
{% endif %}
|
{% 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 %}
|
{% if item.value.load_balancer is defined %}
|
||||||
{% for location in item.value.load_balancer.locations %}
|
{% for location in item.value.load_balancer.locations %}
|
||||||
location {{ item.value.load_balancer.locations[location].location }} {
|
location {{ item.value.load_balancer.locations[location].location }} {
|
||||||
|
Loading…
Reference in New Issue
Block a user