From 939c23183ab145744e8e0fc8c22dcf6ce66ebc25 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Wed, 29 Mar 2017 16:25:21 +0200 Subject: [PATCH] add domain to group_vars and use it in reverse proxy templates --- group_vars/all.yaml.example | 2 ++ roles/reverse_proxy/templates/http.j2 | 2 +- roles/reverse_proxy/templates/map.j2 | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/group_vars/all.yaml.example b/group_vars/all.yaml.example index a3abcf2..2a0a12a 100644 --- a/group_vars/all.yaml.example +++ b/group_vars/all.yaml.example @@ -5,3 +5,5 @@ ext_gateway: "" user_ca_key: "" # Put here the public ip for your organisation public_ip: 0.0.0.0 +# Put here the domain for your organisation +domain: "" diff --git a/roles/reverse_proxy/templates/http.j2 b/roles/reverse_proxy/templates/http.j2 index 3ed5cb6..c278ec5 100644 --- a/roles/reverse_proxy/templates/http.j2 +++ b/roles/reverse_proxy/templates/http.j2 @@ -1,7 +1,7 @@ server { listen {{ public_ip }}:80; - server_name {{ hostname }}.lilik.it www.{{ hostname }}.lilik.it; + server_name {{ hostname }}.{{ domain }} www.{{ hostname }}.{{ domain }}; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/roles/reverse_proxy/templates/map.j2 b/roles/reverse_proxy/templates/map.j2 index 666b8a5..fcbabde 100644 --- a/roles/reverse_proxy/templates/map.j2 +++ b/roles/reverse_proxy/templates/map.j2 @@ -1,2 +1,2 @@ -{{ hostname }}.lilik.it {{ hostname }}_https; -www.{{ hostname }}.lilik.it {{ hostname }}_https; +{{ hostname }}.{{ domain }} {{ hostname }}_https; +www.{{ hostname }}.{{ domain }} {{ hostname }}_https;