lab-ansible/roles/proxy/templates/caddy/Caddyfile.j2

86 lines
1.8 KiB
Caddyfile
Raw Normal View History

# THIS FILE IS MANAGED BY ANSIBLE
2023-12-22 20:57:19 +00:00
# code: language=ansible-jinja
2023-12-22 20:57:19 +00:00
{
admin off
}
{% for env in ['production', 'staging'] %}
# Environment: {{ env }}
2023-12-25 22:17:36 +00:00
ipfs.local.{{ proxy_vars[env].app01.apps_base_domain }} {
2023-12-22 20:57:19 +00:00
tls {{ tls_email }} {
dns njalla {{ njalla_api_token }}
}
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
-Server
}
@local {
remote_ip {{ proxy_trusted_subnets | join(' ') }}
}
handle @local {
reverse_proxy {{ proxy_vars[env].app01.internal_ipv4 }}:8080
}
respond 403
}
2023-12-25 22:17:36 +00:00
ipfs-gateway.{{ proxy_vars[env].app01.apps_base_domain }},
*.ipfs.ipfs-gateway.{{ proxy_vars[env].app01.apps_base_domain }},
*.ipns.ipfs-gateway.{{ proxy_vars[env].app01.apps_base_domain }} {
2023-12-22 20:57:19 +00:00
tls {{ tls_email }} {
dns njalla {{ njalla_api_token }}
}
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
-Server
}
reverse_proxy {{ proxy_vars[env].app01.internal_ipv4 }}:8080
}
2023-12-25 22:17:36 +00:00
xmr.local.{{ proxy_vars[env].app01.apps_base_domain }} {
2023-12-22 20:57:19 +00:00
tls {{ tls_email }} {
dns njalla {{ njalla_api_token }}
}
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
-Server
}
@local {
remote_ip {{ proxy_trusted_subnets | join(' ') }}
}
handle @local {
reverse_proxy {{ proxy_vars[env].app01.internal_ipv4 }}:8080
}
respond 403
}
2023-12-25 22:17:36 +00:00
cloud.{{ proxy_vars[env].app01.apps_base_domain }} {
2023-12-27 18:26:29 +00:00
{% if env == 'production' %}
2023-12-22 20:57:19 +00:00
tls {{ tls_email }}
2023-12-27 18:26:29 +00:00
{% else %}
tls {{ tls_email }} {
dns njalla {{ njalla_api_token }}
}
{% endif %}
2023-12-22 20:57:19 +00:00
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
-Server
}
reverse_proxy {{ proxy_vars[env].app01.internal_ipv4 }}:8080
}
{% endfor %}