Просмотр исходного кода

Make missing /_synapse/admin correctly return 404 responses

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1058

We may try to capture such calls and return a friendlier response (HTML
or JSON) saying "The Synapse Admin API is not enabled", but that may not
be desirable.

For now, we stick to what "upstream" recommends: "simply
don't proxy these APIs", which should lead to the same kind of 404 that
we have now.
See here: 6660912226/docs/reverse_proxy.md (synapse-administration-endpoints)
pull/1059/head
Slavi Pantaleev 4 лет назад
Родитель
Сommit
e4dd933cf0
1 измененных файлов: 7 добавлений и 1 удалений
  1. +7
    -1
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2

+ 7
- 1
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2 Просмотреть файл

@@ -136,7 +136,13 @@
proxy_max_temp_file_size 0;
}

location / {
{#
We only handle the root URI for this redirect or homepage serving.
Unhandled URIs (mostly by `matrix_nginx_proxy_proxy_matrix_client_api_forwarded_location_prefix_regexes` above) should result in a 404,
instead of causing a redirect.
See: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1058
#}
location ~* ^/$ {
{% if matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain %}
return 302 $scheme://{{ matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain }}$request_uri;
{% else %}


Загрузка…
Отмена
Сохранить