@Jakub-Urbanowicz whatever your nginx config, if it was working before, it should not require any changes to support federation.
I would revert back to a working config if you're seeing issues with regular usage of NodeBB. Otherwise if the site is loading fine then tweaking nginx (probably) won't fix anything and the problem likely lies elsewhere.
I will look into your configs tomorrow.