Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/infra/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ server {
resolver_timeout 5s;
set $backend_url ${API_BACKEND_URL};
proxy_pass http://$backend_url;
proxy_set_header Host $host;
# Use the backend hostname, not the incoming request's Host.
# Prevents routing loops when an ALB uses Host-based routing.
proxy_set_header Host $backend_url;
Comment on lines +25 to +27

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion to use $proxy_host won't work -- it's only populated for static upstreams.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this will have to be tested in the OP Sandbox, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not possible due to limited subnet. Hence https://github.com/meaningfy-ws/entity-resolution-ops/pull/30.

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Expand Down
Loading