Nginx Plugin - Can't remove Upstream - Item used by Nginx.sni_hostname

Started by bugacha, April 22, 2025, 12:48:47 PM

Previous topic - Next topic
I added few backends to Upstream, then used them in SNI based routing. After I finished testing, removed SNI based routing but enable to remove unused Upstream.

Just getting "Item in used by" message

Nginx - {Nginx.sni_hostname_upstream_map_item.5dbfd85e-f1aa-43ca-bfa2-313a684a199c}
Item is not referenced anywhere 100%, nothing at all in nginx.conf

Tried to manually grep files in /etc or /usr/local/etc - no matches at all.

Nginx restart or reboot didn't help at all




Any ideas how to fix this ?

I had the same issue today. I started by looking for the string, in all files under the / directory. They were found only in the /conf directory.
You might need to delete the upstream and the configured upstream server UUID lines (I did). Be sure to copy the strings in the errors for both, to use later in the terminal.

Stop DHCP, DNS and, Nginx services (might have to disable Nginx temporarily, to stop it's service) in the WebUI. Otherwise they may write back your edits (that you will need to make, below) into the file, on reboot.

SSH into the device...

Try:

sudo grep -E -w -R "5dbfd85e-f1aa-43ca-bfa2-313a684a199c" /conf/

Edit the files listed by the above command:
sudo vi /conf/config.xml
sudo vi /conf/config-e.xml (I had it in here too and a couple of backups - I left the backups alone.)

In vi use / to find the 5dbfd85e-f1aa-43ca-bfa2-313a684a199c line(s) IE: /5dbfd85e-f1aa-43ca-bfa2-313a684a199c [enter] and [n] to go to the next instance. Use [dd] to delete those lines. Delete all the lines that go with those configured UUIDs (Servers) - but be careful to not delete any others.

Save each file with :x (save and exit file in vi) after your edits.

Now go back to the WebUI and Power --> Reboot

You can SSH back in after the reboot to check the files, to make sure the lines are still gone.

You might still have the Upstream and/or Upstream Server listed in the Nginx WebUI - but you should be able to delete them now... forever.

Good Times! Enjoy.