Some websites like Zoho implement a feature where user signs up for a service and is provided with a <user-name>.website.com url. How is this implemented ?
If this done via configuring Apache / Nginx ?
P.S: If there's a blog post related to this, please post that with your comments.
Sandeep explained how to do it using NGINX. Additionally, you can
However, only the third (and in special cases the second, see Sandeep's answer) option will enable you to generically have subdomains without service-interruptions.
Sandeep Panda
co-founder, Hashnode
Step 1: Add a wild card
(*)host as your A record in DNS.Step 2: In your web server you need to listen to
*.xyz.com. In nginx you will do something like this:server { server_name ~^(.*)\.xyz\.com$ ; root /home; }Step 3: Once the request hits nginx (and if it is configured as reverse proxy), it'll forward the request to a backend such as Node or Python. Your backend code has to parse the host and find out the subdomain. Once you find out the subdomain, rest is easy.
Let me know if you have any questions!