homeserver-iac/roles/caddy/templates/Caddyfile.j2

59 lines
1.1 KiB
Django/Jinja

{
{% if email is not none %}
email {{ email }}
{% endif %}
}
{% if dyndns_domain != domain %}
{{ dyndns_domain }} {
redir https://www.{{ domain }} 302
}
{% endif %}
(external) {
@external not remote_ip {{ internal_cidr }}
}
import conf.d/*
{% if "website" in group_names %}
www.{{ domain }} {
root * {{ website_path }}
file_server
}
{% endif %}
{% if groups["gitea"] | length > 0 %}
{{ gitea_domain }} {
reverse_proxy {{ groups["gitea"][0] }}:3000
}
{% endif %}
{% if groups["navidrome"] | length > 0 %}
{{ navidrome_domain }} {
import external
respond @external 403
reverse_proxy {{ groups["navidrome"][0] }}:4533
}
{% endif %}
{% if groups["synapse"] | length > 0 %}
{{ matrix_domain }} {
reverse_proxy /_matrix/* {{ groups["synapse"][0] }}:8008
reverse_proxy /_synapse/client/* {{ groups["synapse"][0] }}:8008
}
{{ matrix_domain }}:8448 {
reverse_proxy /_matrix/* {{ groups["synapse"][0] }}:8008
}
{% endif %}
{% if groups["paperless"] | length > 0 %}
{{ paperless_domain }} {
import external
respond @external 403
reverse_proxy {{ groups["paperless"][0] }}:8000
}
{% endif %}