diff --git a/doc/management.txt b/doc/management.txt index f83afbe03..7a7c84869 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -2128,7 +2128,8 @@ del backend Removes the backend proxy with the name . This operation is only possible for TCP or HTTP proxies. To succeed, the - backend instance must have been first unpublished. + backend instance must have been first unpublished. Also, all of its servers + must first be removed (via "del server" CLI). There is additional restrictions which prevent backend removal. First, a backend cannot be removed if it is explicitely referenced by config elements, diff --git a/src/proxy.c b/src/proxy.c index 1e5a168b2..b70c70b00 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -5048,6 +5048,11 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm goto out; } + if (be->srv) { + msg = "Only a backend without server can be deleted."; + goto out; + } + /* Second, conditions that may change over time */ ret = 0;