Nginx 502 on proxy upstream to AWS Load Balancer

I was working setting up a nginx server which proxies the requests to AWS LoadBalancer. I made the changes and deployed and it worked!