more modular reverse proxy config

This commit is contained in:
uumas
2022-05-12 00:49:40 +03:00
parent 4c454ec76c
commit 064e270ce4
3 changed files with 24 additions and 1 deletions

View File

@@ -6,7 +6,13 @@
marker: "# {mark} ANSIBLE MANAGED BLOCK {{ vhost_id }}"
block: |
{{ vhost_domains | join(' ') }} {
reverse_proxy {{ proxy_target }}
reverse_proxy {{ proxy_target_protocol }}://{{ proxy_target_host }}:{{ proxy_target_port }} {
{% if proxy_target_protocol == 'https' and proxy_target_host == 'localhost' %}
transport http {
tls_insecure_skip_verify
}
{% endif %}
}
}
validate: 'caddy validate --config %s --adapter caddyfile'
backup: true