Question

Dokku Single App with Multiple Domains

  • Posted on August 15, 2014
  • ndwigaAsked by ndwiga

Am new to digital ocean but would like to know if i can

  1. Use Dokku to create a single Nodejs app with multiple processes (1:web 2: workers) 2. point multiple sub domains (sub.domain1.go, sub.domain2.go etc) to the same app.
  2. Can each of this different sub domain have their own ssl certificates installed in the droplet

Regards


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Check out dokku-shoreman, it allows you to specify worker processes in your ProcFile, much like heroku does.

i.e.

web: forever server.js
worker: workprocess1
worker: workerprocess2

In terms of several domains per app. I would recommend having one main domain (with a cert installed), and redirect the others to it (normally you can set this up in your dns control panel). That way you won’t be penalised by search engines for duplicate content, and it will likely lead to a less confusing experience for your users :).

If it’s all subdomains with the same root doamin, you can create a “wildcard” cert that covers any subdomain. Then in order to use SSL certs with Dokku, check out this from their docs:

To enable TLS across all apps, copy or symlink the .crt/.pem and .key files into the /home/dokku/tls folder (create this folder if it doesn’t exist) as server.crt and server.key respectively. Then, enable the certificates by editing /etc/nginx/conf.d/dokku.conf and uncommenting these two lines (remove the #)