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;
server_name A.com www.A.com;
…
There's a single certificate on the NodeBalancer, which is valid for both domains: A.com and B.com. 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.