Collabora and NextCloud on Same Server Refused to Connect

Hi, I am currently running NextCloud from snap and Collabora on Docker on the same Ubuntu server.

As you can see, it says the server can be reached. This happens regardless of if I use port 81 (apache) or port 9980 (docker)

However, when i open documents, i get “localhost refused to connect”

Any tips?