TLDR: 502 on ubuntu - look for coolmount in coolwsd log - install coolwsd-deprecated
In-depth explanation
So here I was getting 502 Bad Gateway whenever trying to open documents or even just connect to https:///hosting/discovery
I spent an embarrassing amount of time , reading nginx docs ( yes - I use nginx not Apache) , generating tons of logs, adding hostnames to /etc/hosts apart from localhost etc etc etc to no avail
Until i found out what was wrong
In my case It was down do an error arising when coolwsd executed coolmount
Apparently, coolmount does not get installed when following instructions (i.e. fetching from Index of /repos/CollaboraOnline/CODE-deb in my case)
As stated , the error reports in my case were misleading hinting anything apart from the problem ( although the coolwsd error log actually showed the problem but drowned in tons of other messages ,)
to solve the problem I just added the missing bits by installing
sudo apt install coolwsd-deprecated
and after that, hosting/discovery responded correctly
I had to add WOPI network infor ( in my case just adding 192.168.0.0/16 to get running ) and thats it! Nextcloud Office works again
I think it would have been good if either the coolwsd-deprecated package got installed with the main package ( speaking for ubuntu only as I didnt test anything else )
Hopefully, someone may save some time