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

Update matrix-domain.conf.j2

exchanged "^~" with "~" as a pattern matching in the location part.
I am very sure, that it only works using "~". I am not quite sure though, if this is the right way to do it, because "~" is probably more expensive than "^~"

the rewrite has to be behind the definition of the $backend. Otherwise nginx will fail to work. This is probably because "break" goes directly to the proxy_pass which uses $backend.
pull/2985/head
T. Küchel 2 лет назад
committed by GitHub
Родитель
Сommit
920139be70
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
1 измененных файлов: 5 добавлений и 6 удалений
  1. +5
    -6
      roles/custom/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2

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

@@ -185,15 +185,14 @@
{% endif %}

{% if matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled %}
location ^~ /_matrix/client/(r0|v3)/user_directory/search {
{% if matrix_nginx_proxy_proxy_matrix_user_directory_search_v3_to_r0_redirect_enabled %}
rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
{% endif %}

location ~ /_matrix/client/(r0|v3)/user_directory/search {
{% if matrix_nginx_proxy_enabled %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
set $backend "{{ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container }}";
set $backend "{{ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container }}";
{% if matrix_nginx_proxy_proxy_matrix_user_directory_search_v3_to_r0_redirect_enabled %}
rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
{% endif %}
proxy_pass http://$backend;
{% else %}
{# Generic configuration for use outside of our container setup #}


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