From 7d8dde8a5372b5d1e9a628e09275bcb91e92097d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 29 May 2019 08:32:06 +0300 Subject: [PATCH] Add support for proxying /_synapse/admin APIs Fixes #191 (Github Issue). --- .../nginx/conf.d/matrix-synapse.conf.j2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2 b/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2 index d927f373b..eda0929b8 100644 --- a/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2 +++ b/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2 @@ -169,6 +169,25 @@ server { } {% endif %} + location /_synapse/admin { + {% if matrix_nginx_proxy_enabled %} + {# Use the embedded DNS resolver in Docker containers to discover the service #} + resolver 127.0.0.11 valid=5s; + set $backend "{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container }}"; + proxy_pass http://$backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }}; + {% endif %} + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + + client_body_buffer_size 25M; + client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb }}M; + proxy_max_temp_file_size 0; + } + location / { rewrite ^/$ /_matrix/static/ last; }