Shoopify app aws deployment

Hi there.

I am facing problem with authentication from shopify in ec2 instance, i am running shopify app env show to see the environment variables. When i run it, the shopify asks for authentication, i wait for shopify to provide the link and open in a new browser tab, then i log into my account and then when it comes to redirecting it fails. It tries to redirect to 127.0.0.1 but fails. How can I fix this?