502 Bad Gateway after updating to latest version

Did you follow the advice in PostgreSQL 15 update? You might also vaccuum the database.