cloudserve-infrastructure/roles/whoami/templates/whoami_upstream.json.j2
Marty Oehme daef2b7f13
Add conditional default subdomain setting to proxy
If a domain has been declared for the host, the upstream file will proxy
at a subdomain named for the stack it proxies to,
otherwise it will do the same for the path.
2021-07-30 11:50:10 +02:00

30 lines
570 B
Django/Jinja

{
"@id": "{{ stack.name }}_upstream",
{% if domain is not undefined and not none %}
"match": [
{
"host": [
"{{ stack.name }}.{{ domain }}"
]
}
],
{% else %}
"match": [
{
"path": [
"/{{ stack.name }}*"
]
}
],
{% endif %}
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "{{ stack.name }}_app:80"
}
]
}
]
}