Matrix: Replace nginx with caddy
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tobias Manske 2023-03-28 13:11:48 +02:00
parent 1c8604bad1
commit 28d0210897
Signed by: tobias
GPG Key ID: 9164B527694A0709
3 changed files with 16 additions and 20 deletions

View File

@ -0,0 +1,12 @@
{
auto_https off
}
http://{{ matrix.baseurl }} {
header {
Content-Type application/json
Access-Control-Allow-Origin *
}
respond /.well-known/matrix/client "{\"m.homeserver\": {\"base_url\": \"https://synapse.{{ matrix.baseurl }}\"} }" 200
respond /.well-known/matrix/server "{\"m.server\": \"synapse.{{ matrix.baseurl }}:443\"}" 200
}

View File

@ -61,12 +61,11 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
nginx: caddy:
# FIXME: This could be caddyv2 image: caddy:2
image: nginx:stable
restart: unless-stopped
volumes: volumes:
- ./nginx-well-known.conf:/etc/nginx/conf.d/matrix.conf:ro,Z - ./Caddyfile:/etc/caddy/Caddyfile:ro,z
restart: unless-stopped
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.matrix-well-known.rule=Host(`{{ matrix.baseurl }}`) && PathPrefix(`/.well-known/matrix/`)" - "traefik.http.routers.matrix-well-known.rule=Host(`{{ matrix.baseurl }}`) && PathPrefix(`/.well-known/matrix/`)"

View File

@ -1,15 +0,0 @@
server {
listen 80;
server_name {{ matrix.baseurl }};
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://synapse.{{ matrix.baseurl }}"} }';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
location /.well-known/matrix/server {
return 200 '{"m.server": "synapse.{{ matrix.baseurl }}:443" }';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
}