From 58ca2e7dfddbebbbcde32fdb49de181768033623 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Mon, 4 Feb 2019 09:03:43 -0600 Subject: [PATCH] Turn off IPv6 when using your own Nginx server Docker apparently doesn't like IPv6. --- .../templates/nginx/conf.d/matrix-synapse.conf.j2 | 1 + roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) 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 734ddb5b..6417b77c 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 @@ -110,6 +110,7 @@ server { {% else %} {# Generic configuration for use outside of our container setup #} proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }}; + resolver 127.0.0.1 ipv6=off; {% endif %} proxy_set_header Host $host; diff --git a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 index e6537ef0..2cca864e 100644 --- a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -144,9 +144,7 @@ listeners: # On Linux and Mac OS, `::` will listen on all IPv4 and IPv6 # addresses by default. For most other OSes, this will only listen # on IPv6. - bind_addresses: - - '::' - - '0.0.0.0' + bind_addresses: ['::'] # This is a 'http' listener, allows us to specify 'resources'. type: http @@ -174,7 +172,7 @@ listeners: # For when matrix traffic passes through loadbalancer that unwraps TLS. - port: 8008 tls: false - bind_addresses: ['::', '0.0.0.0'] + bind_addresses: ['::'] type: http x_forwarded: true