Conditionally restart NGINX
Before restarting nginx, check if the current app is using a proxy and if the selected proxy is in fact NGINX. Only then should we bother invoking the nginx reload. Fixes https://github.com/dokku/dokku/issues/4987
This commit is contained in:
1 parent
c4ce25415b
commit
c209787de8
1 file changed
+7
-1
@@ -128,7 +128,13 @@ validate_nginx() {
|
|||||||
|
|
||||||
restart_nginx() {
|
restart_nginx() {
|
||||||
declare desc="restart nginx for given distros"
|
declare desc="restart nginx for given distros"
|
||||||
fn-nginx-vhosts-nginx-init-cmd "reload"
|
local PROXY_ENABLED="$(plugn trigger proxy-is-enabled "$APP")"
|
||||||
|
local PROXY_TYPE="$(plugn trigger proxy-type "$APP")"
|
||||||
|
if [[ "$PROXY_ENABLED" == "true" ]]; then
|
||||||
|
if [[ "$PROXY_TYPE" == "nginx" ]]; then
|
||||||
|
fn-nginx-vhosts-nginx-init-cmd "reload"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
nginx_logs() {
|
nginx_logs() {
|
||||||
|
|||||||
Reference in new issue
Block a user