cloudserve-infrastructure/roles/caddy/templates/config.json.j2
Marty Oehme da1e696292
Fix https redirect setting
Fixed the reverse setting for https redirection. It would redirect when
the option was toggled off and vice versa.
2021-10-20 17:39:24 +02:00

79 lines
1.7 KiB
Django/Jinja

{
{% if caddy_use_api is sameas false %}
"admin": {
"disabled": true
},
{% endif %}
{% if caddy_use_debug is sameas true %}
"logging": {
"logs": {
"default": {
"level": "DEBUG"
}
}
},
{% endif %}
"apps": {
"http": {
"servers": {
"{{ caddy_http_server_name }}": {
"listen": [
":80"
],
"routes": []
{% if caddy_use_https is sameas false %},
"automatic_https": {
"disable": true
}
{% endif %}
},
"{{ caddy_https_server_name }}": {
"listen": [
":443"
],
"routes": []
{% if caddy_use_https is sameas false %},
"automatic_https": {
"disable": true
}
{% endif %}
}
}
}
{% if caddy_use_https is sameas true %},
"tls": {
"automation": {
"policies": [
{
"subjects": [],
"issuers": [
{% if caddy_tls_use_staging is sameas true %}
{
"ca": "https://acme-staging-v02.api.letsencrypt.org/directory",
{%- if caddy_email is not undefined and not none %}
"email": "{{ caddy_email }}",
{% endif %}
"module": "acme"
}
{% else %}
{
{%- if caddy_email is not undefined and not none %}
"email": "{{ caddy_email }}",
{% endif %}
"module": "acme"
},
{
{%- if caddy_email is not undefined and not none %}
"email": "{{ caddy_email }}",
{% endif %}
"module": "zerossl"
}
{% endif %}
]
}
]
}
}
{% endif %}
}
}