matrix-docker-ansible-deploy/examples/reverse-proxies/caddy2-in-container
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
..
Caddyfile
docker-compose.yaml
README.md Added an example of fronting the playbook's integrated Traefik reverse-proxy with the existing Caddy container (#3514) 2024-09-14 09:06:40 +03:00

Caddy reverse-proxy fronting the playbook's integrated Traefik reverse-proxy

This directory contains a sample config that shows you how to front the integrated Traefik reverse-proxy webserver with your own containerized Caddy reverse-proxy. If you have a server with a Caddy container already serving several applications and you want to install Matrix on it (with no changes to existing traffic routing), then this guide is for you.

Note: if you're running Caddy on the host itself (not in a container), refer to the caddy2 example instead.

Prerequisite configuration

To get started, first follow the front the integrated reverse-proxy webserver with another reverse-proxy instructions and update your playbook's configuration (inventory/host_vars/matrix.<your-domain>/vars.yml).

Then, adjust your Caddy docker-compose.yaml file (if you're using docker-compose for running your Caddy container). See examples/reverse-proxies/caddy2-in-container/docker-compose.yaml.

Using the Caddyfile

You can either just use the Caddyfile directly or append its content to your own Caddyfile. In both cases make sure to replace all the example.tld domains with your own domain.

This example does not include additional services like Element, but you should be able copy the first block and replace the matrix. subdomain with the subdomain of the some other service (e.g. element.).