Change your config.json to domain.com:4567
Then use nginx to forward reverse proxy 80 to port 4567 using the example in NodeBBs documentation
My forum was running ok but last night suddenly it start showing 502 bad gateway.
I was looking for issue but after 5min soon I started nodebb from terminal, it started working. But again it started showing the same 502 bad gateway error.
502 bad gateway is the error that nginx returns when NodeBB isn't running. Try running NodeBB will
./nodebb slog or
./nodebb dev and look for errors. Odds are that it is encountering an error and dying.