ugh. our Node API sits behind nginx on the same VM. It listens on 8000. Its been fine for months, but now only under load we get this:

502 Bad Gateway
nginx
if i SSH in and curl localhost:8000 I get a 200 insatntly. Restarting nginx fixes it for a while. Im out of ideas and support tickets are piling up.
config hasnt changed in ages, as far as i know. the nginx config test passes, the apps own logs look normal, and CPU and memory on teh box are fine... what should i check first so i stop guessing??
