From 0a2f602ff36029af9204f224cc3c4ee0e181ea91 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 15 Nov 2023 23:42:51 +0100 Subject: [PATCH] dispatch main requests to main server --- .../config/synapse-generic-worker-sync.yaml | 14 -------------- .../synapse/config/synapse-worker-generic.yaml | 11 ++++++----- .../files/synapse/nginx/synapse.conf | 17 ++++++++++------- 3 files changed, 16 insertions(+), 26 deletions(-) delete mode 100755 ansible/roles/docker-compose/files/synapse/config/synapse-generic-worker-sync.yaml diff --git a/ansible/roles/docker-compose/files/synapse/config/synapse-generic-worker-sync.yaml b/ansible/roles/docker-compose/files/synapse/config/synapse-generic-worker-sync.yaml deleted file mode 100755 index 961d6fe..0000000 --- a/ansible/roles/docker-compose/files/synapse/config/synapse-generic-worker-sync.yaml +++ /dev/null @@ -1,14 +0,0 @@ -worker_app: synapse.app.generic_worker -worker_name: synapse-generic-worker-sync - -worker_listeners: - - type: http - port: 8083 - resources: - - names: [client] - - type: http - port: 9083 - resources: - - names: [replication] - -worker_log_config: /data/generic-worker-log.yaml diff --git a/ansible/roles/docker-compose/files/synapse/config/synapse-worker-generic.yaml b/ansible/roles/docker-compose/files/synapse/config/synapse-worker-generic.yaml index a2f28e8..0a1af9a 100755 --- a/ansible/roles/docker-compose/files/synapse/config/synapse-worker-generic.yaml +++ b/ansible/roles/docker-compose/files/synapse/config/synapse-worker-generic.yaml @@ -2,9 +2,10 @@ worker_app: synapse.app.generic_worker worker_name: synapse-worker-generic worker_listeners: - - type: http - port: 8008 + - port: 8008 + type: http + tls: false + x_forwarded: true resources: - - names: - - client - - federation + - names: [client, federation] + compress: false diff --git a/ansible/roles/docker-compose/files/synapse/nginx/synapse.conf b/ansible/roles/docker-compose/files/synapse/nginx/synapse.conf index c7f5f7c..038f52c 100644 --- a/ansible/roles/docker-compose/files/synapse/nginx/synapse.conf +++ b/ansible/roles/docker-compose/files/synapse/nginx/synapse.conf @@ -36,17 +36,20 @@ server { } - # All other matrix/synapse requests + # Client requests + location ~ ^/_matrix/client/(api/v1|r0|unstable)/publicRooms$|^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/joined_members$|^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/context/.*$|^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/members$|^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/state$|^/_matrix/client/(api/v1|r0|unstable)/account/3pid$|^/_matrix/client/(api/v1|r0|unstable)/devices$|^/_matrix/client/(api/v1|r0|unstable)/keys/query$|^/_matrix/client/(api/v1|r0|unstable)/keys/changes$|^/_matrix/client/versions$|^/_matrix/client/(api/v1|r0|unstable)/voip/turnServer$|^/_matrix/client/(api/v1|r0|unstable)/joined_groups$|^/_matrix/client/(api/v1|r0|unstable)/publicised_groups$|^/_matrix/client/(api/v1|r0|unstable)/publicised_groups/|^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/event/|^/_matrix/client/(api/v1|r0|unstable)/joined_rooms$|^/_matrix/client/(api/v1|r0|unstable)/search$ { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_pass http://synapse-worker-generic:8008; + } + + # All other matrix/synapse requests go to main location ~ /_matrix|/_synapse { proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; - proxy_connect_timeout 600s; - proxy_send_timeout 600s; - proxy_read_timeout 600s; - send_timeout 600s; - - proxy_pass http://synapse-worker-generic:8008; + proxy_pass http://synapse-main:8008; } }