Nginx does not route traffic to Node js server in AWS ElasticBeanstalk

Viewed 70

Using ElasticBeanstalk to deploy an NodeJS web application. I have the Nginx config file like below:

events {}
http {
  server { # simple reverse-proxy
    listen       80;
    # pass requests for dynamic content
    location / {
      proxy_pass      http://localhost:5000;
    }
  }
}

I have the node server starting at port 5000.

I see the Nginx seems starting ok as well:

2021/08/25 16:16:28.573953 [INFO] Executing instruction: start proxy with new configuration
2021/08/25 16:16:28.573976 [INFO] Running command /bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf
2021/08/25 16:16:28.678857 [INFO] Running command /bin/sh -c cp -rp /var/proxy/staging/nginx/* /etc/nginx
2021/08/25 16:16:28.698889 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2021/08/25 16:16:28.717393 [INFO] Running command /bin/sh -c systemctl daemon-reload
2021/08/25 16:16:28.824685 [INFO] Running command /bin/sh -c systemctl reset-failed
2021/08/25 16:16:28.829180 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2021/08/25 16:16:28.834724 [INFO] Running command /bin/sh -c systemctl is-active nginx.service
2021/08/25 16:16:28.838286 [INFO] Running command /bin/sh -c systemctl start nginx.service

But when I click the ElasticBeanstalk link, I see it goes to the default AWS Nginx page with title Welcome to nginx on Amazon Linux!

Did I miss anything in the config?

0 Answers
Related