Nginx server configuration devdojo.com
Jan 3rd, 2022 08:06 PM
Tony, what nginx configuration do you use on the devdojo server? I am especially interested in the part of the blog, where a domain of ricardo.com is redirected to ricardo.devdojo.com.
Jan 4th, 2022 12:33 AM・
We have a catch-all Nginx server block to catch all of the subdomain names.
You can define this by specifying the following servername:
The redirect itself is then handled by using the Laravel subdomain routing as described in the official docs here.
Hope that this helps!
Jan 4th, 2022 06:17 AM
Thank you very much Bobby for your quick response. The configuration that you tell me works perfectly with a subdomain of devdojo, but what happens when the domain is not devdojo? in my account I have the possibility to use my own domain. rvalenzuela.com and when I configure this in cloudflare with the cname to rvalenzuela.devdojo.com it works with my url rvalenzuela.com, that's my question. How in Laravel do you interpret that it is a subdomain, if the url is rvalenzuela.com?
Jan 4th, 2022 06:37 AM
There could be different ways of doing this, but one way would be to have a model which contains your custom domains and maps them to the respective subdomains / usernames.
Jan 4th, 2022 02:42 PM
Jan 4th, 2022 02:44 PM
Sadly don't know of any free courses on the subject off the top of my head. But you could always search for Laravel multitenancy and see what's out there.
Hope that gives you any ideas. 🙂
Edit: Seems you found what you were looking for as I was writing my answer. 👍 Gonna leave my answer here in-case some other users is looking for the same information.