我的 nginx 配置文件是
服务器 { 监听 ip 地址:80 ;
server_name subdomain.domain.com;
server_name www.subdomain.domain.com;
server_name ipv4.subdomain.domain.com;
location / {
proxy_pass http://ip-address:32038/;
proxy_set_header Host $host;
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 $scheme;
proxy_http_version 1.1;
fastcgi_read_timeout 3000;
}
}
服务器{监听ip地址:443 ssl http2;
server_name subdomain.domain.com;
server_name www.subdomain.domain.com;
server_name ipv4.subdomain.domain.com;
ssl_certificate /opt/psa/var/certificates/scf83NyxP;
ssl_certificate_key /opt/psa/var/certificates/scf83NyxP;
ssl_client_certificate /opt/psa/var/certificates/scfrr8L8y;
proxy_read_timeout 60;
location / {
proxy_pass https://ip-address:30588/;
proxy_set_header Host $host;
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 $scheme;
}
}
我的网站http://subdomain.mydomain.com运行良好。但是当我使用https://subdomain.mydomain.com它显示由 nginx 提供的 bad gateway 错误页面
通过 ssh 当我运行以下命令时一切正常
对于 http curl -v -HHost:subdomain.mydomain.comhttp://ip地址:32038
curl -v subdomain.mydomain.com
对于 https curl -v -HHost:subdomain.mydomain.comhttps://subdomain.mydomain.com:30588
从服务器节点 SSH curl -v -HHost:subdomain.mydomain.com --resolve subdomain.mydomain.com:30588:ip-address --cacert /opt/psa/var/certificates/scf83NyxPhttps://subdomain.mydomain.com:30588
curl -v -HHost:subdomain.mydomain.com --cacert /opt/psa/var/certificates/scf83NyxPhttp://ip地址:32038
任何帮助都将不胜感激。
谢谢