feat(traefik): configurable extra_hosts for container DNS overrides
Add `traefik_extra_hosts` (list of `host:ip`) that maps straight into the traefik container's compose `extra_hosts`. Needed when a downstream middleware (e.g. ForwardAuth to authentik on a sibling LAN) has to resolve a public FQDN to an internal IP because the DMZ doesn't hairpin the public address back inside. Empty by default; behaviour unchanged for existing inventories.
This commit is contained in:
parent
02d45026a5
commit
afe5950d77
2 changed files with 13 additions and 0 deletions
|
|
@ -11,6 +11,13 @@ service_name: traefik
|
|||
docker_compose_dir: "{{ docker_compose_base_dir }}/{{ service_name }}"
|
||||
docker_volume_dir: "{{ docker_volume_base_dir }}/{{ service_name }}"
|
||||
|
||||
# Optional /etc/hosts entries injected into the traefik container. Useful
|
||||
# when downstream middlewares (e.g. ForwardAuth to an authentik instance
|
||||
# running on a sibling LAN) need a public FQDN to resolve to an internal
|
||||
# IP because the DMZ doesn't hairpin the public address back inside.
|
||||
# Example: ["auth.example.com:172.16.19.101"]
|
||||
traefik_extra_hosts: []
|
||||
|
||||
# Deployment mode: 'dmz' or 'backend'
|
||||
# - dmz: Public-facing reverse proxy that routes to backend servers using file provider
|
||||
# - backend: Application server with docker provider for local container discovery
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ services:
|
|||
{% endif %}
|
||||
networks:
|
||||
- {{ traefik_network }}
|
||||
{% if traefik_extra_hosts | default([]) | length > 0 %}
|
||||
extra_hosts:
|
||||
{% for h in traefik_extra_hosts %}
|
||||
- "{{ h }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
{{ traefik_network }}:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue