@mwaeckerlin said in Again: «Looks like your connection to NodeBB was lost, please wait while we try to reconnect.» - in Docker Swarm:
@PitaJ, the problem is, that not the url setting is *
, but the origin that arrives in socket.io.
Yes I understood your problem.
With a reverse proxy, I can handle same origin in nginx, centralized before it passes through to NodeBB, even more: NodeBB always gets all requests from only one source, from the reverse proxy server. So I suggest that the same origin feature should be optional: On by default, but it should be possible to disable it in reverse proxy environments.
Did you go to the link? You can configure the socket.io origins by adding the following to config.json:
"socket.io": {
"origins": "*"
}
Them you can add the same origin check to nginx.
I see that the origin reported from socket.io is *
, but I don't understand yet, why and how.
I'm no nginx wizard either. It's pretty much voodoo to me as well. That's why I suggested trying a cut down config. If a config based closely on the one in our docs worked, then it's likely possible to figure out what the issue is based on differences between them.
I don't have enough experience to diagnose exactly what is wrong.
exactly which option in the suggested nginx configuration passes the origin to the backend NodeBB?
I want to understand. Up to now, everything sounds like voodoo, such as «certain options which are dependent on the order» or «almost certainly a configuration issue». So what exactly is the problem? Which options are responsible for setting the origin? Which options depend in the order? What is why the correct order? AFAIK, order is not relevant for all options. I would like to have an educated understanding of what happens and why, not something that works by coincidence.
I don't know enough about nginx to answer these questions. I just know that our config does work, and yours doesn't.
One more thing: none of us core devs know much about docker, which is why the documentation and defaults aren't very good for it.