So, I am working on a Multi-tenant, multi-database SaaS application that is currently hosted using Caddy 2 on a server in the US. I have been receiving complaints that users in countries like Australia and Singapore are facing performance issues because of latency. I wanted to see if there was a way to setup caddy in a way that it can automatically use servers located nearest to the users if I setup new servers in Australia and Singapore. Are there any documentation or blog posts that you can help with this scenario?
Here are a few things to note:
The app has 2 areas (b2c and b2b)
On the b2b side of the app:
- When the request is being forwarded to the nearest server of the user, the urls cannot change. Need some kind of proxy
On the b2c side of the app,
- they can configure what domain the app will be available on, so in this case the domains change and we pick up the nearest server of the users visiting the customers side of the app.
This is applicable for both b2b and b2c:
- the nearest web server will also be configured to use a database server that is closest to them. I am assuming this has nothing to do with Caddy and it has to do with multi-AZ deployment of your database.
Any ideas how I can do this with Caddy?