502 bad gateway nginx with laravel

I successfully deployed my laravel app in render but the problem is:
when I leave my app for a while (like an hour) and try to revisit it again , it takes like 5 minutes to load and return 502 bad gateway but when I refresh this error page it works fine.
I checked my logs when try to open the website and I found that it redeploy the whole app again each time I visit the link and it returns this in the logs:
“client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:80”
any help please for this??

Hey there,
That sounds like you’re using our free plan so your service is being spun down after 15 minutes of no activity https://render.com/docs/free

Our behaviour is to restart the service when the next request is made here,

Regards,

John B