From f85e613b050badabf09c241468527d89661dede0 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 19 Dec 2024 14:53:04 -0500 Subject: [PATCH] FIX: Set the Host header in the nginx.conf upstream block Using e.g. `proxy_pass http://discourse` resets the Host header on the upstream request to `discourse`. This would break multisites, so we don't want that; the most effetive way to ensure it's set properly is to `set_header` in the upstream block. --- templates/web.template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/web.template.yml b/templates/web.template.yml index d5dd09526..5a7c18790 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -146,6 +146,7 @@ run: filename: "/etc/nginx/conf.d/discourse.conf" from: /upstream[^\}]+\}/m to: "upstream discourse { + set_header Host $http_host; server 127.0.0.1:3000; }"