dokku-nginx-alt is a alternative plugin for dokku that configures nginx as a reverse proxy to deployed dokku app. There are a number of design changes between this plugin and the standard built in dokku-vhosts plugin:
- Moved configuration file from
post-deploy
into separate template files:nginx.conf
andnginx.ssl.conf
. - Ability to override default .conf files with user's own nginx configuration
files placed in
/home/git/$APP
. - Ability to deploy an app under multiple custom domains. The
VHOST
file can now contain a list of domains that nginx will serve to. VHOST
file is decoupled frompost-deploy
in thatpost-deploy
no longer overwritesVHOST
after each deploy. Custom domains are set independently in theVHOST
file.- Ability to mix SSL and non-SSL domains. For example,
VHOST
may containmydomain.com
and*.mydomain.com
where SSL certificates only apply to*.mydomain.com
. This plugin generates both SSL configurations for the wildcard domains and non-SSL configuration for the root domain. - Added helper messages during deploy.
This plugin has been tested on dokku version 0.2.3.
-
Remove the default
nginx-vhost
plugin:rm -rf /var/lib/dokku/plugins/nginx-vhost
-
Install the plugin by cloning into the dokku plugins directory:
git clone https://github.com/mikexstudios/dokku-nginx-alt.git /var/lib/dokku/plugins/nginx-alt
-
Create a
VHOST
file in your dokku app directory (e.g./home/dokku/[app name]/VHOST
) and add each domain name on a separate line. -
To over-ride the default
nginx.conf
andnginx.ssl.conf
templates, place copies renamed asnginx.template
andnginx.ssl.template
in your/home/dokku/$APP
directory. When you re-push your application, you should see a message like:-----> Overriding default SSL nginx.conf with detected nginx.template...
-
Re-push your app.
backup-export
andbackup-import
hook scripts have intentionally not been included to reduce the complexity of this plugin.
The MIT License (MIT)