CTRL + W usually deletes everything until the previous whitespace, so it would delete the whole '/var/log/nginx/' string in OP's example. Alt + backspace usually deletes until it encounters a non-alphanumeric character.
Be careful working CTRL + W into muscle memory though, I've lost count of how many browser tabs I've closed by accident...
Set $WORDCHARS accordingly. In your case, remove / from $WORDCHARS.
Ctrl-Shift-T usually brings that tab right back at least
> Be careful working CTRL + W into muscle memory though, I've lost count of how many browser tabs I've closed by accident...
This hurts.
Also, for the shell, if you do C+w, you can "paste" it back using C+y. Assuming you have not removed that configuration.
In my terminal it's the exact opposite – Alt-Backspace deletes to the previous space, whereas Ctrl-W deletes to the last non-alphanumeric (such as /). I'm using fish shell in an Alacritty terminal.
Yeah, pressing Ctrl-W accidentially is a pain sometimes ... but Ctrl-Shift-T in Firefox is a godsend.