'Can't reach this page took too long to respond. Django, Gunicorn and Nginx. This is until I reboot my instance manually

I hosted my Django website on AWS Lightsail instance on an Ubuntu server with Nginx and Gunicorn.

Everything works fine when it is running super fast everything works great, but sometimes it stops running, I can't reach the website only until I restart my lightsail instance manually. This I think happens in the interval of 24 hours (probably).

I don't know why it is happening? what causing it?

Someone suggested to me that it's something related to the server itself, Server goes to sleep, or something but when any request comes it can't respond to that.

If there is anything that you want to see to get more info plz comment I'll add that. I don't have much idea about this problem, I'll appreciate your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source