My cloud provider have a load balancer, which all our requests go to. And that load balancer then redirects the requests to multiple servers.
If I have a server outside of the load balancer I can easily generate the certs with certbot, however when I put it behind the load balancer sometimes the acme-challenge requests goes to other servers underneath the load balancer.
I'm running Ubuntu 22.04 with Nginx, my plan was to redirect all acme challenges on the other servers to the issueing server and then have a cronjob which syncs the cert over the other servers.
You could use dns validation. Or you could set the other servers as reverse proxies for the one on which Certbot is running. Or you could sync the challenge files on all servers, probably using the webroot method.
In short: There are no wrong answers/many ways to do this.
So long as it solves your problem, you are comfortable with the solution, and you can troubleshoot it quickly should trouble arise.
If the two systems can see each other, then update the /etc/hosts file in system two to point to system one [for that domain].
That will force the challenge requests to system one.
third option: nginx could look at server_name (this I really don't know)
I put the IP address there directly because nginx should forward all the sni stuff to the proxied server (right now I don't remember if it does so by default or it needs configuration)
It worked out great, I added the domain in the /etc/hosts.
Since the services never talk to the domains themselves it should be more than fine. And there are multiple domains on all servers, this worked for all domains and they now generate it correctly.