0

I did not set up this app in AWS but now have to look after it. I am seeing the following error in nginx error log:

upstream timed out (110: Connection timed out) while reading response header from upstream

I am seeing from other SO answers that a resolution is to modify the nginx config. Before I modify anything I would like to know what is there currently. Is that possible? Thx.

yen
  • 953
  • 1
  • 6
  • 23

1 Answers1

0

Yes, you can see the config here: /etc/nginx/nginx.conf

Then you can then create a file in conf.d folder so nginx will include it. You should do this via .ebextensions, and create a file named for example nginx.config (must have a .config extension) with the following content :

files:
      "/etc/nginx/conf.d/000_my_config.conf":
      content: |
        upstream xxxxx {
          yourContentGoesHere
    }
Ali
  • 954
  • 5
  • 14
  • I'm sorry - I didnt accept bcos I don't know how to follow the advice here: >Yes, you can see the config here: /etc/nginx/nginx.conf I'm not AWS savvy. Does `/` refer to the root path *inside* the container? If so I'm still stuck because I think the container for this app is built by an under-the-hood pipeline process from the build pipeline direct into aws. I don't see `.exbextensions` in the source tree either. :-/ – yen Apr 26 '20 at 13:08
  • Nginx runs as a proxy on the host, listens on port 80 and redirects traffic to the upstream i.e your container. It is not inside the container. So the path /etc/nginx/nginx.conf is on the EC2 host not inside the container. You will have to create the folder .ebextensions inside your source bundle if you want to change any of the nginx configurations. Follow the directions in the link provided in my answer. – Ali Apr 26 '20 at 13:37
  • Alright, accepting ur answer. Unfortunately I just can't figure out how to see `/etc/nginx/nginx.conf` in AWS, to see the current config, so I'm not really any further ahead. But that's on me, not you. Thanks! – yen Apr 26 '20 at 19:45
  • You have to ssh into the EC2 instance that's spun up by Beanstalk. Open the EC2 console, and you should see the instance with the same name as your Beanstalk environment name. But before that you will need to allow port 22 on the security group of Beanstalk and add a key. Both of these actions will replace your existing instance. This answer explains it further: https://stackoverflow.com/a/4921866/8925518 – Ali Apr 26 '20 at 19:55