분류없음 2013/07/24 15:50
I think that it's because nginx is not detecting that the upstream is down
because it's on the same machine.
The options that you're looking for are: proxy_next_upstream and proxy_connect_timeout.
Try this:
location / {
proxy_pass http://lb;
proxy_redirect off;
proxy_next_upstream error timeout invalid_header http_500; #헤더가 500이거나, 응답이 없거나, 에러거나 할 경우 다음 서버로 넘김
proxy_connect_timeout 2; # 2초 이후에
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
The options that you're looking for are: proxy_next_upstream and proxy_connect_timeout.
Try this:
location / {
proxy_pass http://lb;
proxy_redirect off;
proxy_next_upstream error timeout invalid_header http_500; #헤더가 500이거나, 응답이 없거나, 에러거나 할 경우 다음 서버로 넘김
proxy_connect_timeout 2; # 2초 이후에
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
http://zosel.net/trackback/71
0