Is it possible to use a load balancer with multiple zones?
If yes, how would each server in the pool know which zone was hit when responding to the request?
So here’s the use case:
Let’s say I have a couple of VPS distributed around the world. I create a load balancer and a pool for domainA.com. The domain is added to Cloudflare, but the servers in the pool are only IPs. I don’t need SSL between Cloudflare and the origin servers, but I do need it between Cloudflare and my users.
Now I want to add domainB.com, domainC.com, etc, for my customers as new zones in our account or using the SSL for SaaS service. Could these also use the same load balancer with the configured pool?
Let’s say all this is working. Now my VPS are receiving the requests from the load balancer. How would I know which was the original request that was made? Does Cloudflare include the original URL into a header or can this be configured in some way?
Eg: User requests domainB.com/hello.html it goes to the load balancer which requests to 23.45.111.43/hello.html. How would I know in my server it’s domainB.com?
I’m still not getting through, but let me see if I got it.
domainA --> request-->Hits the Balancer --BalancerSend to:--> server2 accepted -->logsOfserver2//bydomainA
domainB--> request-->Hits the Balancer --BalancerSend to:--> Pool-server1 accepted -->logsOfserver1//byDomainB
Are we ok until here on the architecture or am I missing something?
I can understand maybe its more complicated than that, if it is, help us to understand more your thoughts
hmmm, I think in that case, you should set that up on the application level, right?.
But again something is missing in your question.
Will you have subdomains, or different domains?
If its not logs the case , which platform will you use?
I think these are questions that you can do on the application layer, on the development and not so much on the server (well of course also on the server side, but more straightforward).
If I remember well WordPress can play quite easily for such a case, In any way, Cloudflare will pull and serve anything your app (and origin) give.
Yes, obviously the logic to display different content would go into the application.
But to do that the application needs to know which domain the request comes from. Yes?
How does the application know that?
For example, Stackpath (a Cloudflare competitor) puts an HTTP header whenever it makes a request to origin with the original requested URL. So then the application can read that HTTP header and do something with it.