Skip to content

Commit

Permalink
FIX: Set the Host header in the nginx.conf upstream block
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Supermathie committed Dec 19, 2024
1 parent 0e76758 commit f85e613
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/web.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}"

Expand Down

0 comments on commit f85e613

Please sign in to comment.