有2个域名: main.domain.com
和 sub.domain.com
所以我需要 sub.domain.com
代理传递给 main.domain.com/somepath
,但现在我 grab 了 main.domain.com
的作品和 sub.domain.com
:
[错误] 27961#27961:* 14上游超时(110:连接超时),同时从上游读取响应头,客户端:ip.ip.ip.ip,server:sub.domain.com,请求:“GET / HTTP / 1.1“,上游:”http://127.0.0.1:8000/“,主持人:”sub.domain.com“
我的nginx配置看起来像:
server {
listen 80;
client_max_body_size 1000m;
charset utf-8;
server_name main.domain.com;
location / {
fastcgi_pass 127.0.0.1:8000;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
}
server{
listen 80;
server_name sub.domain.com;
location / {
proxy_pass http://127.0.0.1:8000/somepath;
proxy_set_header Host main.domain.com;
}
}