Dokku Single App with Multiple Domains

August 15, 2014 2.5k views

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


2 Answers

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 #)

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


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 :).

Have another answer? Share your knowledge.