diff --git a/group_vars/testing.yml b/group_vars/testing.yml index 458184e..2f99c5c 100644 --- a/group_vars/testing.yml +++ b/group_vars/testing.yml @@ -5,4 +5,3 @@ docker_swarm_advertise_addr: eth1 caddy_use_debug: yes caddy_use_https: no caddy_tls_use_staging: yes -caddy_create_test_file_server: yes diff --git a/roles/whoami/templates/whoami_upstream.json.j2 b/roles/whoami/templates/whoami_upstream.json.j2 index de14a2f..f272643 100644 --- a/roles/whoami/templates/whoami_upstream.json.j2 +++ b/roles/whoami/templates/whoami_upstream.json.j2 @@ -1,13 +1,30 @@ { - "@id": "{{ stack.name }}_upstream", - "handle": [ - { - "handler": "reverse_proxy", - "upstreams": [ + "@id": "{{ stack.name }}_upstream", +{% if domain is not undefined and not none %} + "match": [ { - "dial": "{{ stack.name }}_app:80" + "host": [ + "{{ stack.name }}.{{ domain }}" + ] } - ] - } - ] + ], +{% else %} + "match": [ + { + "path": [ + "/{{ stack.name }}*" + ] + } + ], +{% endif %} + "handle": [ + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "{{ stack.name }}_app:80" + } + ] + } + ] }