![]() |
502 Bad Gateway errors on nginx server
I now have Calibre Content Server running with nginx as a virtual host, which has received a SSL certificate from Certbot for security's sake. They all run on Ubuntu 20.04 on a VPS. And I also set up a startup service that runs Calibre:
Code:
/opt/calibre/calibre-server /home/ubuntu/Calibre --enable-local-write --enable-auth --auth-mode "basic" --ban-after 5 --ban-for 5 --log /home/ubuntu/log/calibre.logCode:
[error] 641#641: *1773 connect() failed (111: Connection refused) while connecting to upstream ...Any idea why this might happen? Is there anything I can do to fix this? |
You sure there is nothing in the calibre server logs? Does it happen after doing a particular type of activity?
|
Yes, nothing on calibre.log other than the normal:
Code:
calibre server listening on 0.0.0.0:8080 |
Without anything in the logs I cant really help you. Other than to suggest that you make sure you are running the official calibre binaries and not the distro packaed version of calibre.
|
Understood. And yes, I am using the official binaries. Will try to get more info if I can.
|
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. |
| All times are GMT -4. The time now is 05:35 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.