matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Traefik configuration fails to redirect well-known

Open baloan opened this issue 2 years ago • 2 comments

The description how to setup a reverse proxy with Traefik https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-own-webserver.md lacks a feature. Add the following labels to matrix-nginx-proxy to remediate:

  - '--label "traefik.http.routers.wellknown.rule=Host(`{{ matrix_domain }}`) && PathPrefix(`/.well-known`)"'
  - '--label "traefik.http.routers.wellknown.entrypoints=web-secure"'
  - '--label "traefik.http.routers.wellknown.tls.certResolver=default"'
  - '--label "traefik.http.routers.wellknown.middlewares=nginx"'
  - '--label "traefik.http.middlewares.nginx.redirectregex.regex=^https://{{ matrix_domain }}/(.*)"'
  - '--label "traefik.http.middlewares.nginx.redirectregex.replacement=https://{{ matrix_server_fqn_matrix }}/$${1}"'

baloan avatar Jul 15 '22 19:07 baloan

Legend! I was trying to figure this out!!!! Thanks a bunch. @baloan

mwerx avatar Sep 01 '22 02:09 mwerx

Follow up: Sometimes on the federation tester it displays fine results. The other times I get a Connection Errors Non-200 response 502 from remote server

I also sometimes get

Got 1 connection report.

There was an error looking up homeserver version information: contents=[66 97 100 32 71 97 116 101 119 97 121] msg=Failed to GET JSON (hostname "matrix.mydomain.com:8448" path "/_matrix/federation/v1/version"): Bad Gateway code=502 wrapped=

mwerx avatar Sep 05 '22 06:09 mwerx

Thanks! ^^. I had to add this label to make it work: - '--label "traefik.http.routers.wellknown.service=matrix-nginx-proxy"'

juadsan avatar Jan 24 '23 12:01 juadsan