title: Magento redirecting AWS Load Balancer
body: <p>Good afternoon,</p>
  
  <p>I have a Magento installation with Nginx running on an Auto Scaling Group on AWS with a standard 3 instances. To redirect traffic I use a load balancer with SSL causing my structure looks as follows:</p>
  
  <p>User> Load Balancer (Port 443)> Instance (Port 80)</p>
  
  <p>I changed into my database in the table mg_core_config_data the URLs to use https.</p>
  
  <p>The problem I think is happening is the following:</p>
  
  <p>Every time I access my URL, Load Balancer attempts to fetch the bodies content to send me the information I am requesting, in this way, as I am using port 80, when the Load Balancer reaches my instance and attempts to load the Magento, the base_url that is in the database redirects to https. With this redirection, the process is repeated again because I'm redirected back to https: // and try to get the instance information on port 80 again. I think that every problem is among this base_url and I can not return the magento information with port 80.</p>
  
  <p>Follow my nginx configuration:</p>
  
  <pre><code>server {
      listen 80 DEFAULT_SERVER;
  
      server_name _;
      root /home/ubuntu/www/mysite;
      index index.php index.html index.htm;
  
      location / {
          try_files $ uri $ uri / /index.php$is_args$args;
      }
  
      location ~ \ .php $ {
          try_files $ uri /index.php = 404;
          fastcgi_pass unix: /run/php/php7.0-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
          fastcgi_params include;
          fastcgi_cache CACHE;
          fastcgi_cache_methods GET HEAD;
          fastcgi_cache_valid 200 1m;
          fastcgi_cache_bypass $ no_cache;
          fastcgi_no_cache $ no_cache;
      }
  
      ...
  }
  </code></pre>
  
  <p>The error I'm getting accessing my load balancer via https:</p>
  
  <p><a href="https://i.stack.imgur.com/l3p0O.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/l3p0O.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/1IVJk.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/1IVJk.jpg" alt="enter image description here"></a></p>
  
  <p>Anyone have any suggestions or have been through this?</p>
  
  <p>Thank you.</p>