Reimplement redirect domains
Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>
This commit is contained in:
parent
b449a279cd
commit
59fa4a73f2
1
compose/05_caddy/.env
Normal file
1
compose/05_caddy/.env
Normal file
@ -0,0 +1 @@
|
|||||||
|
COMPOSE_PROJECT_NAME=caddy
|
10
compose/05_caddy/Caddyfile
Normal file
10
compose/05_caddy/Caddyfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
auto_https off
|
||||||
|
}
|
||||||
|
|
||||||
|
{% for rule in redirect.hosts %}
|
||||||
|
http://{{ rule.from }} {
|
||||||
|
redir https://{{ rule.to }}{uri} permanent
|
||||||
|
}
|
||||||
|
|
||||||
|
{% endfor %}
|
21
compose/05_caddy/docker-compose.yml
Normal file
21
compose/05_caddy/docker-compose.yml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
version: "3.4"
|
||||||
|
|
||||||
|
services:
|
||||||
|
redirect:
|
||||||
|
image: caddy:2
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro,z
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.caddyredir.rule={{ redirect.hosts | map(attribute='from') | map('regex_replace', '^(.*)$', 'Host(`\\1`)') | join(' || ') }}"
|
||||||
|
- "traefik.http.routers.caddyredir.entryPoints=websecure"
|
||||||
|
- "traefik.http.services.caddyredir.loadbalancer.server.port=80"
|
||||||
|
- "com.centurylinklabs.watchtower.scope=update"
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- gateway
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gateway:
|
||||||
|
external: true
|
Loading…
Reference in New Issue
Block a user