1

I am using a ssl certificate provided by comodo that seems to me to be propely configured because my website is showing the https correctly. However, I am getting 502 Bad Gateway when I access my store with ssl.

I am using nginx server and this is how I am doing this.

server {
root /var/www/html/public/;
index index.php index.html;

listen       80  default_server;

error_log  /var/log/nginx/error-zzdefault.log;
access_log /var/log/nginx/access-zzdefault.log;

location / {
    proxy_pass http://magento/;
}

location /phpmyadmin/ {
    proxy_pass http://phpmyadmin/;
}

}


server {
listen       443 ssl;
server_name  mydomain.com.br;

keepalive_timeout   70;

ssl_certificate      /etc/nginx/ssl/mydomain-bundle.crt;
ssl_certificate_key  /etc/nginx/ssl/mydomain.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

error_log  /var/log/nginx/error-zzdefault.log;
access_log /var/log/nginx/access-zzdefault.log;

root /var/www/html/public/;
index index.php index.html;


location / {
  proxy_pass https://magento/;

}
}
Rafael Padovani
  • 95
  • 1
  • 10

1 Answers1

0

Alter the proxy_pass on the second server location who has SSL certified: The Ip 32.999.999.999:80 should be your server main Ip address. Passing the default port 80.

location / {
      proxy_pass http://32.999.999.999:80;
      proxy_set_header X-Real-IP  $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header X-Forwarded-Port 443;
      proxy_set_header Host $host; }
Sérgio Thiago Mendonça
  • 1,161
  • 2
  • 13
  • 23