I think I figured out what went wrong.
So my VPS instance has only 512 MBs of RAM. Although all it does is running Calibre Content Server on nginx, it still runs out of memory through time. And when the memory runs out on a Linux machine, something named Out of Memory (OOM) killer is triggered and kills Calibre, which results in nginx not being able to connect to the backend so finally "502 Bad Gateway".
I added 1GB of swap memory to my instance, and Calibre has not been killed since then.
|