From 775000883a46498e368d7bcedfdb3cd81bf5527f Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 18 Jan 2024 11:31:59 +0200 Subject: [PATCH] Fix Jinja issue related to Synapse workers keepalive templating Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3114 --- .../conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 b/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 index c94855d59..8b5446d91 100644 --- a/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 +++ b/roles/custom/matrix-synapse-reverse-proxy-companion/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 @@ -12,7 +12,7 @@ {% macro render_worker_upstream(name, workers) %} {% if workers | length > 0 %} upstream {{ name }} { - keepalive {{ workers | length * 2 }}; + keepalive {{ ((workers | length) * 2) | string }}; {% for worker in workers %} server "{{ worker.name }}:{{ worker.port }}"; {% endfor %} @@ -42,7 +42,7 @@ # ensures that requests from the same client will always be passed # to the same server (except when this server is unavailable) hash $http_x_forwarded_for; - keepalive {{ generic_workers | length * 2 }}; + keepalive {{ ((generic_workers | length) * 2) | string }}; {% for worker in generic_workers %} server "{{ worker.name }}:{{ worker.port }}";