Does a Node Balancer pass along the HTTP Host header?

I'm running Nginx on my back-end servers and I'm trying to setup sub domains. My question is simple, does a Node Balancer pass any details about the domain through the HTTP headers? If it doesn't, how do people configure sub domains when the desired effect is to have domain.com sub1.domain.com and sub2.domain.com go to the same Nginx server and have Nginx determine the routing based on the host name used.

2 Replies

When in HTTP or HTTPS mode all headers are kept intact, but a new X-Forwarded-For and X-Forwarded-Proto header are added to forward the IP address and protocol of the request. Setting up multiple domains or subdomains in Nginx should work for you as it would when the connections are going straight to your Linode.

However, you can also set up the NodeBalancer in TCP mode. This will pass all connections directly through to the back-end Linode with no alterations, and can be used with protocols other than HTTP or HTTPS as well.

I've left the following guides that go over health checks and configuring x-forward-header as well. These should help point you in the right direction.

https://www.linode.com/docs/platform/nodebalancer/nodebalancer-reference-guide/#health-checks

https://www.linode.com/docs/platform/nodebalancer/nodebalancer-reference-guide/#x-forwarded-for-header

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct