In case this is still being investigated I had a 502 gateway error but not directly after the update routine which failed midway with a Ruby versioning error. Since I had not updated the server in about six weeks I ran apt update/upgrade and rebooted. That’s when the 502 error occurred, I could not raise the forum website. Rebuilding app fixed things and also updated Discourse fully.
For the record I have these plugins installed and enabled:
discourse-bbcode
discourse-data-explorer
discourse-docs
docker_manager
styleguide
and these installed but disabled:
discourse-topic-list-previews
discpage