matrix-docker-ansible-deploy/examples/reverse-proxies/caddy2-in-container/Caddyfile
comeUpWithItLater 11e241e30a
Added an example of fronting the playbook's integrated Traefik reverse-proxy with the existing Caddy container (#3514)
* Added an example of fronting the playbook's integrated Traefik reverse-proxy with the existing Caddy container (not the `apt-get` or `yum` installed Caddy).  Helpful for folks who have an existing server with a Caddy container already serving multiple applications.

* Update examples/reverse-proxies/caddy2-in-container/README.md

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

* Update examples/reverse-proxies/caddy2-in-container/README.md

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

* Update examples/reverse-proxies/caddy2-in-container/README.md

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

* Code formatted, linted with yamllint

* README.md updated

* docs/configuring-playbook-own-webserver-caddy.md removed

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2024-09-14 09:06:40 +03:00

44 lines
1.6 KiB
Caddyfile

matrix.example.tld {
handle {
encode zstd gzip
# Use the docker service name instead of localhost or 127.0.0.1 here
matrix-traefik:8080 {
header_up X-Forwarded-Port {http.request.port}
header_up X-Forwarded-TlsProto {tls_protocol}
header_up X-Forwarded-TlsCipher {tls_cipher}
header_up X-Forwarded-HttpsProto {proto}
}
}
}
# Put `https://` at the beginning to enforce https protocol as 8448 is not the default https port (which is 443)
https://matrix.example.tld:8448 {
handle {
encode zstd gzip
# Use the docker service name instead of localhost or 127.0.0.1 here
reverse_proxy matrix-traefik:8448 {
header_up X-Forwarded-Port {http.request.port}
header_up X-Forwarded-TlsProto {tls_protocol}
header_up X-Forwarded-TlsCipher {tls_cipher}
header_up X-Forwarded-HttpsProto {proto}
}
}
}
example.tld {
# Uncomment this if you are following "(Option 3): Setting up reverse-proxying of the well-known files from the base domain's server to the Matrix server" of https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-3-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server
@wellknown {
path /.well-known/matrix/*
}
handle @wellknown {
reverse_proxy https://matrix.example.tld {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
}