目前我有两个域名,都解析到同一个 IP,并且这个两个域名都是可以 ping 通的,两个域名假设是:a.com, b.com,下面是我两个站点的配置:
####################### a.com这个站点 #############################
upstream app1 {
server unix:/tmp/unicorn.app1.sock fail_timeout=0;
}
server {
server_name a.com;
listen 80;
root /var/www/apps/app1/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @user1;
location @user2 {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_pass http://app1;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
####################### b.com这个站点 #############################
upstream app2 {
server unix:/tmp/unicorn.app2.sock fail_timeout=0;
}
server {
server_name b.com;
listen 80;
root /var/www/apps/app2/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @user3;
location @user4 {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_pass http://app2;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
现在的问题是当我访问其中一个域名是,站点是能正常访问的,但是另一个访问不到,用 chrome 查看发现请求 assets 的时候处于 pending 状态, 然后过一会请求就失败了,请教一下,这种是什么问题呢?