以下是我在Nginx中的上游块
upstream sample{
server abc1.example.com down;
server abd2.example.com down;
}
在这种情况下,错误日志显示以下错误:
no live upstreams while connecting to upstream, client: 10.196.90.83, server: abc_sample_a , request: "GET / HTTP/1.1", upstream: "http://sample/", host: "abc_sample_a
目前,收到的错误代码是502.但我想返回503错误代码。
答案 0 :(得分:1)
这应该有效:
server {
...
error_page 502 = @fallback;
...
location @fallback {
return 503;
}
}