From fef1951d57d155763da51b09900927fa81dba842 Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Tue, 5 Mar 2019 08:28:53 +0100 Subject: [PATCH] Add necessary nginx configs to get matrix federation to work --- roles/docker/files/configs/matrix/vhost-matrix | 1 + roles/docker/files/configs/matrix/vhost-root | 14 ++++++++++++++ roles/docker/tasks/services/matrix_riot.yml | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 roles/docker/files/configs/matrix/vhost-matrix create mode 100644 roles/docker/files/configs/matrix/vhost-root diff --git a/roles/docker/files/configs/matrix/vhost-matrix b/roles/docker/files/configs/matrix/vhost-matrix new file mode 100644 index 00000000..36b8434b --- /dev/null +++ b/roles/docker/files/configs/matrix/vhost-matrix @@ -0,0 +1 @@ +listen 8008; \ No newline at end of file diff --git a/roles/docker/files/configs/matrix/vhost-root b/roles/docker/files/configs/matrix/vhost-root new file mode 100644 index 00000000..5e814d2e --- /dev/null +++ b/roles/docker/files/configs/matrix/vhost-root @@ -0,0 +1,14 @@ +location /_matrix { + proxy_pass http://0.0.0.0:8008; + proxy_set_header X-Forwarded-For $remote_addr; +} + +location /.well-known/matrix/server { + default_type application/json; + return 200 '{"m.server": "matrix.data.coop:443"}'; +} + +location /.well-known/matrix/client { + default_type application/json; + return 200 '{"m.homeserver": {"base_url": "https://matrix.data.coop"}}'; +} diff --git a/roles/docker/tasks/services/matrix_riot.yml b/roles/docker/tasks/services/matrix_riot.yml index 93fbdeb7..9a95722d 100644 --- a/roles/docker/tasks/services/matrix_riot.yml +++ b/roles/docker/tasks/services/matrix_riot.yml @@ -31,6 +31,11 @@ src: files/configs/riot/riot.im.conf dest: "{{ riot.volume_folder }}/data/riot.im.conf" +- name: upload vhost config for root domain + template: + src: files/configs/matrix/vhost-root + dest: "{{ nginx.volume_folder }}/vhost/{{ base_domain }}" + - name: matrix database container docker_container: name: matrix_db