matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Connection to telegrab-bridge via nginx proxy - incorrect config

Open eking-go opened this issue 4 years ago • 0 comments

As I realize, it is there: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-domain.conf.j2#L119

Now generated configuration looks like:

location /prefix {
                resolver 127.0.0.11 valid=5s;
        set $backend "matrix-mautrix-telegram:8080";
        proxy_pass http://$backend;
}

But have to be like:

location ~ /prefix/(.*) {
                resolver 127.0.0.11 valid=5s;
        set $backend "matrix-mautrix-telegram:8080";
        proxy_pass http://$backend/$1;
}

Then queries to provisioner will pass without prefix:

 curl https://matrix.domain.com/prefix/_matrix/provision/v1/bridge
{"relaybot_username": null}

That inside of container of provisioner looks like (so, inside of container it do not have prefix, and nginx do not have to proxy query with prefix)

$ curl http://172.18.0.16:8080/_matrix/provision/v1/bridge
{"relaybot_username": null}

log

Apr 28 15:37:03 ip-172-31-13-14 matrix-mautrix-telegram[12706]: [2021-04-28 15:37:03,791] [[email protected]] 172.18.0.16 [28/Apr/2021:15:37:03 +0000] "GET /_matrix/provision/v1/bridge HTTP/1.1" 200 184 "-" "curl/7.69.1"

eking-go avatar May 20 '21 15:05 eking-go