From 2158c5c6b9cb85f619ce2529547a903e87753ba3 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 1 Apr 2019 17:57:13 +0200 Subject: [PATCH] Pass Matrix Webhook through reverse proxy --- .../nginx/nginx-sites-available-main.j2 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/roles/nginx-reverse-proxy/templates/nginx/nginx-sites-available-main.j2 b/roles/nginx-reverse-proxy/templates/nginx/nginx-sites-available-main.j2 index ddb8bc3..f4ebf9a 100644 --- a/roles/nginx-reverse-proxy/templates/nginx/nginx-sites-available-main.j2 +++ b/roles/nginx-reverse-proxy/templates/nginx/nginx-sites-available-main.j2 @@ -82,3 +82,26 @@ server { proxy_set_header X-Forwarded-For $remote_addr; } } + +server { + listen 9442 ssl; + listen [::]:9442 ssl; + + # Set witch server name we define + server_name auro.re; + + # Separate log files + access_log /var/log/nginx/main.access.log; + error_log /var/log/nginx/main.error.log; + + # Use LetsEncrypt SSL + ssl_certificate /etc/letsencrypt/live/auro.re/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/auro.re/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/auro.re/chain.pem; + + # For Matrix Appservice Webhooks + location / { + proxy_pass http://synapse.adm.auro.re:9000; + proxy_set_header X-Forwarded-For $remote_addr; + } +}