Files
dokku/plugins/nginx-vhosts/internal-functions
Jose Diaz-Gonzalez 66b2fb602f feat: implement proxy-clear-config
This will allow us to kill stale proxy configuration within apps, which is critical during application renames.

- redirect rmdir output to dev-null
- trigger a proxy-clear-config (new trigger) when renaming an application
  - The configuration will be rebuilt during the later `ps_rebuild`

Closes #3231
2018-07-28 01:20:06 -04:00

35 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
nginx_vhosts_help_content_func() {
declare desc="return nginx plugin help content"
cat<<help_content
nginx:build-config <app>, (Re)builds nginx config for given app
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
help_content
}
nginx_vhosts_help_cmd() {
if [[ $1 = "nginx:help" ]] ; then
echo -e 'Usage: dokku nginx[:COMMAND]'
echo ''
echo 'Interact with Dokku'"'"'s Nginx proxy.'
echo ''
echo 'Additional commands:'
nginx_vhosts_help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
nginx_vhosts_help_content_func
else
cat<<help_desc
nginx, Interact with Dokku's Nginx proxy
help_desc
fi
}
nginx_clear_config() {
declare desc="Remove the nginx conf file"
declare APP="$1";
rm -f "$DOKKU_ROOT/$APP/nginx.conf"
}