我的Nginx配置如下:
server {
listen 443 ssl;
server_name sub1.domain.com sub2.domain.com sub3.domain.com subn.domain.com;
ssl on;
ssl_certificate /path/to/cert/ssl-bundle.crt;
ssl_certificate_key /path/to/key/domain.key;
ssl_prefer_server_ciphers on;
...
}
现在,在某些情况下,我收到以下错误日志的502 Bad Gateway异常:
upstream prematurely closed connection while reading response header from upstream,
client: 1.2.3.4, server: sub1.domain.com, request: "POST /xxx/xxx/xxx/?o=1 HTTP/1.1",
upstream: "http://unix:/run/gunicorn.sock:/xxx/xxx/xxx/?o=1", host: "sub2.domain.com",
referrer: "https://sub2.domain.com/xxx/xxx/xxx/?o=1"
请注意,服务器具有 sub1 .domain.com,但主机和引荐来源网址是 sub2 .domain.com。
问题是:
谢谢!
PS:我正在使用Gunicorn作为应用程序服务器来提供Python / Django应用程序。