![我的 Web 应用程序在一台服务器和两个工作节点上运行](https://linux22.com/image/749446/%E6%88%91%E7%9A%84%20Web%20%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%9C%A8%E4%B8%80%E5%8F%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%92%8C%E4%B8%A4%E4%B8%AA%E5%B7%A5%E4%BD%9C%E8%8A%82%E7%82%B9%E4%B8%8A%E8%BF%90%E8%A1%8C.png)
我的 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
任何帮助都将不胜感激。
谢谢