【问题标题】:Magento 2 - 502 Bad Gateway after ssl configurationMagento 2 - ssl 配置后的 502 Bad Gateway
【发布时间】:2018-06-09 04:45:54
【问题描述】:

我正在使用由 comodo 提供的 ssl 证书,在我看来配置正确,因为我的网站正确显示了 https。但是,当我使用 ssl 访问我的商店时,我收到了 502 Bad Gateway。

我正在使用 nginx 服务器,我就是这样做的。

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/;

}
}

【问题讨论】:

    标签: ssl magento2 magento2.1


    【解决方案1】:

    更改已通过 SSL 认证的第二个服务器位置上的 proxy_pass: Ip 32.999.999.999:80 应该是您的服务器主 IP 地址。通过 默认端口 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; }
    

    【讨论】:

      猜你喜欢
      • 2020-07-12
      • 2016-04-20
      • 1970-01-01
      • 2014-04-30
      • 1970-01-01
      • 1970-01-01
      • 2011-01-29
      • 2015-07-25
      • 1970-01-01
      相关资源
      最近更新 更多