DNS management in a multi-tenant setup
ฝัง
- เผยแพร่เมื่อ 1 มิ.ย. 2024
- #laravel #webdevelopment #webdev
DNS management on a larger scale, for example in a multitenant application, can be a a massive pain. In this video we’ll be taking a look at how you can manage hundreds, if not thousands of custom domains for your multi-tenant application, without a headache!
00:00 - Introduction
00:16 - Multitenant DNS management
01:50 - Configuring custom domains
03:08 - Dynamic reverse proxies
06:13 - Final words
Very helpful! Thank you! Your content is amazing! You bring us topics that are not often discussed in the Laravel/PHP ecosystem!
Glad it was helpful!
Good insights, thank you. Love the multi-tenancy/SaaS topics.
For my SaaS, I have the clients set up a CNAME to my domain instead of an A record, so I have the IP under control. I add the custom client domain as Alias in Laravel Forge, then re-issue the cert. Let's Encrypt is limited to 100 aliases though, but I'm just starting out, so that's not a problem.
Keep up the good work!
Sure, but CNAME doesn’t work for root domains unfortunately, only for subdomains.
@@sabatino-dev Whilst that is true, CNAME flattening has been a thing nowadays with many modern DNS providers, which could make it a better manageable option in many cases.
Very helpful information ❤
Looking forward to your videos 🎉🎉
Glad you like them!
Thank you
You're welcome, hope it was helpful!
Your applicatiom demo plz@@sabatino-dev
You are so amazing and I am so happy that I pressed the bell on the subscribe. You are a gem seriously, thank you. This is so valuable. Have you ever done database replication for your company?
Thanks for the kind words! 🙏 we do replication on AWS RDS, and AWS DMS has been a massive help to migrate our database to RDS.
Great Video! - I'm currently tackling this problem for laravel multi-tenancy. What do you think about "Cloudflare Custom Hostnames" and then using the "Flexible" SSL Option to eliminate having to create certificates and finally adding an Alias using the laravel forge API.
It’ll probably work, but IMO doing Nginx config work in Forge for every custom domain will bite you in the ass down the line. If you need to scale for example, you’ll be burdened with a massive amount of config changes.
Very interesting content, thank you! Could you share your practices on handling tenant/user ids?
If I’m not mistaken he has a video with this content.
This video covers it: Learnings from our multi-tenant Laravel application
th-cam.com/video/Lmope5CdM10/w-d-xo.html
Very helpful!. @sabatino , I was wondering. use ceryx to proxy the requests to target loadbalance. do we need to dynamic add server block on nginx? since the beginning of this videos you said no need to change ngxin config. how does target server's nginx server handle requests with custom domain. ?
Updated: after try it out. get error 629 SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream
The target server should handle things automatically, since Ceryx rewrites the host header. No additional Nginx config is needed on the target.
@@sabatino-dev thanks. I try Traefik
Yesterday, also works did learn something.
@@sabatino-dev I did solve the redirect issue. for everybody. just make sure laravel application should trust the proxy in the middleware. This make it works. thanks buddy, This way is more easy maintanable.
@kenlin2135 nice!
for sub domain of each users. did u use wildcard domain name?
Yes, wildcard subdomain DNS record!