I use several services that allow for host mapping to their servers. An example is ZenDesk, which the default address would be company.zendesk.com but you could for example use helpdesk.company.com (assuming you own the address).

I'm trying to figure out how they do this in an automated manner. I know that I can manually duplicate the sites-available 000-default.conf file and update the domain name references, but surely there's a way companies like ZenDesk do this without having to manually update these files for each setup.

How would I do this?


If you have a hosted product, one really easy way is to just have one vhost that answers every request and then look into the actual request headers to see what domain was requested in your code and then work with this.

Depending on the specific circumstances, that might be all there is to it or you might have more complex situations, in the worst case having some kind of config management write out config fragments for every customer.

| improve this answer | |
  • I'm using digitalocean. I have no idea how I would even go about setting that up. – Aninemity Jul 12 '16 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.