From 95993955c5193b12736778c1872fef8c0b10b18d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 7 Apr 2016 21:15:59 -0400 Subject: [PATCH] Move customizing-hostnames documentation [ci skip] --- docs/nginx.md | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/docs/nginx.md b/docs/nginx.md index a173a6fdc..6ab080814 100644 --- a/docs/nginx.md +++ b/docs/nginx.md @@ -131,36 +131,14 @@ chown dokku:dokku /home/dokku/myapp/nginx.conf.d/upload.conf service nginx reload ``` -## Customizing hostnames - -Applications typically have the following structure for their hostname: - -``` -scheme://subdomain.domain.tld -``` - -The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial configuration and stored in the `$DOKKU_ROOT/VHOST` file. It can then be modified with `dokku domains:set-global`. This value is used as a default TLD for all applications on a host. - -If a FQDN such as `other.tld` is used as the application name, the default `$DOKKU_ROOT/VHOST` will be ignored and the resulting vhost URL for that application will be `other.tld`. The exception to this rule being that if the FQDN has the same ending as the default vhost (such as `subdomain.domain.tld`), then the entire FQDN will be treated as a subdomain. The application will therefore be deployed at `subdomain.domain.tld.domain.tld`. - -You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. For example, you can reverse the subdomain with the following sample `nginx-hostname` plugin trigger: - -```shell -#!/usr/bin/env bash -set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x - -APP="$1"; SUBDOMAIN="$2"; VHOST="$3" - -NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev` -echo "$NEW_SUBDOMAIN.$VHOST" -``` - -If the `nginx-hostname` has no output, the normal hostname algorithm will be executed. - -### Domains plugin +## Domains plugin See the [domain-configuration documentation](/dokku/deployment/domain-configuration/). +## Customizing hostnames + +See the [customizing hostnames documentation](/dokku/deployment/domain-configuration/#customizing-hostnames). + ## Disabling VHOSTS See the [disabling vhosts documentation](/dokku/deployment/domain-configuration/#disabling-vhosts).