Expose mautrix-telegram public endpoint through nginx

It used to allow user to logging with their own account to the bot
see: https://github.com/tulir/mautrix-telegram/wiki/Authentication#replacing-telegram-accounts-matrix-puppet-with-matrix-account
for more informations
This commit is contained in:
Hugues Morisset
2018-10-21 23:20:37 +02:00
parent c7188e06f9
commit 83a17f8439
3 changed files with 20 additions and 6 deletions

View File

@ -73,6 +73,20 @@ server {
}
{% endif %}
{% if matrix_mautrix_telegram_enabled %}
location {{ matrix_mautrix_telegram_public_endpoint }} {
{% 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-mautrix-telegram:8080";
proxy_pass http://$backend;
{% else %}
{# Generic configuration for use outside of our container setup #}
proxy_pass http://localhost:8080;
{% endif %}
}
{% endif %}
location /_matrix {
{% if matrix_nginx_proxy_enabled %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}