From 2153fb6731c1dab86dbc9a2e5c79e99a414567c2 Mon Sep 17 00:00:00 2001 From: Jin-Guk Kwon Date: Tue, 14 Sep 2021 18:02:25 +0200 Subject: [PATCH] [type]Update manifest for Task#9465 --- type/__ungleich_matrix/manifest | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/type/__ungleich_matrix/manifest b/type/__ungleich_matrix/manifest index c2fbb4f..dab6acb 100755 --- a/type/__ungleich_matrix/manifest +++ b/type/__ungleich_matrix/manifest @@ -176,12 +176,38 @@ require="__package/nginx" __file /etc/nginx/sites-enabled/synapse-upstreams \ $("$__type"/files/nginx-upstream-config.sh) EOF -require="__package/nginx __file/etc/nginx/sites-enabled/synapse-upstreams" \ +if [ -f "$__object/parameter/synapse-worker-mode" ]; then + require="__package/nginx __file/etc/nginx/sites-enabled/synapse-upstreams" \ + __ungleich_nginx_vhost "$synapse_domain" \ + --listen '443 [::]:443' \ + --rules "$(cat << EOF + ##worker + include /etc/nginx/conf.d/generic_worker.conf; + + location ~* /_synapse/metrics { + proxy_pass http://localhost:9000; + include /etc/nginx/conf.d/synapse-proxy.conf; + } + + ## + location ~* ^(/_matrix|/_synapse) { + proxy_pass http://localhost:8008; + include /etc/nginx/conf.d/synapse-proxy.conf; + } + location / { + proxy_pass http://localhost:8008; + include /etc/nginx/conf.d/synapse-proxy.conf; + } +EOF +)" +else + require="__package/nginx __file/etc/nginx/sites-enabled/synapse-upstreams" \ __ungleich_nginx_static_site "$synapse_domain" \ --owner "$www_directory_owner" \ --listen '443 [::]:443' \ --base_directory "$nginx_basedir" \ --locationopt "$("$__type"/files/nginx-vhost-config.sh)" +fi # Delegate Matrix federation to port 443 & configure server discovery from # clients if matrix_domain is element_domain (= both are handled by this