From fef6c052c34404a15985a87ad9593596c349cd04 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 17 Jan 2019 16:25:08 +0200 Subject: [PATCH] Pass Host/X-Forwarded-For everywhere It hasn't mattered much to have these so far, but it's probably a good idea to have them. --- .../templates/nginx-conf.d/matrix-riot-web.conf.j2 | 3 ++- .../templates/nginx-conf.d/matrix-synapse.conf.j2 | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 index 87ccc532..967a4355 100644 --- a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 +++ b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 @@ -50,6 +50,7 @@ server { proxy_pass http://localhost:8765; {% endif %} - proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; } } diff --git a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2 b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2 index a88bf27e..1a2d166b 100644 --- a/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2 +++ b/roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2 @@ -57,6 +57,9 @@ server { {# Generic configuration for use outside of our container setup #} proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container }}; {% endif %} + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; } {% endif %} @@ -109,6 +112,7 @@ server { proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }}; {% endif %} + proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; client_body_buffer_size 25M;