How to configure a NodeBalancer with two linodes each running a different name-based virtual host?

I have one NodeBalancer connected to two working linodes (both up). Linode A serves site A via nginx. Linode B serves site B via nginx. Their configs include the following.

server {
listen 80;
listen [::]:80;


There's a single certificate on the NodeBalancer, which is valid for both domains: and The SSL connection terminates there and http is used to communicate to each linode. Incoming http requests are redirected to use https.

How do I configure the NodeBalancer to send a request to each linode until there's a server_name match?

2 Replies

This isn’t a typical setup for a NodeBalancer.

Typically both Linodes would serve site A and B, and the NodeBalancer would balance the traffic between them.

I don’t believe your scenario would be possible with a single NB but Linode support might be able to advise differently.

I would use HAProxy to do this for you, it can terminate SSL and do routing.


Please enter an answer

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] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct