title: 'ERR_TOO_MANY_REDIRECTS' error nginx docker
body: <p>I am using nginx docker for deploying my app in aws server. I have to access my api using nginx proxy url which looks like <code>https://domain.com/api/</code>. This is a https request so i have to set proxy redirection to another port where api service running and the service is running under another docker container in same server instance. so my nginx conf file looks like below,</p>
  
  <pre><code>    server {
         listen         80;
         server_name    domain.com;
         return         301 https://$server_name$request_uri;
  }
  
  server {
         listen         443 ssl;
         server_name    domain.com;
         # add Strict-Transport-Security to prevent man in the middle attacks
         add_header Strict-Transport-Security "max-age=31536000";
         location /api/ {
              proxy_pass http://my-public-ip-address:3000;
          }
  
  }
  </code></pre>
  
  <p>So my problem is that while I am trying to access the api endpoint using above url its showing <code>ERR_TOO_MANY_REDIRECTS</code>. So any one know about this issue? And also i went through all the article with same issue mentioned but no luck. </p>