I tested this multiple times, I created an image of perfectly working OpenLiteSpeed server on EC2, and when I deploy it, it doesn't connect or it connects but extremely slow (it takes around 1 min for page to load).
I just created a simple php page with echo. Nothing too tricky however it does work if I take an image and re-deploy it.