How to resolve HTTP 502 error?

I have not tried to build another server, but when I switch the server’s ram to 4GB, things get worse.