Question

I'm developing a web app. Users will sign up and will be assigned a sub-domain which will allow them to access content via account-456.myappsdomain.com. The intention of having that sub-domain though isn't for them to visit it directly. Instead, they'll be informed to point the CNAME for www.their-own-site.com to account-456.myappsdomain.com in order for them to be able to visit their own domain and view their content directly on their own domain. Is is possible, using Nginx, to create a configuration that will allow this without me having to edit the config or add a virtual host every time a user signs up for an account?

Currently, my app uses the host header (splitting on the dots to get the account-456 bit) to get the account ID, and then sets up the theme based on that. I assume that with this new sort of configuration, I'd check the host header for their domain (which I will have had them enter into the app), query for the domain (and the account it belongs to) and set up their theme that way. Is this correct?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top