Loading...
This site is best viewed in a modern browser with JavaScript enabled.
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
balancer_by_lua阶段如何获取上游502的具体原因
xly880713
如题,上游响应502,有可能是与上游网络不通,也有可能是上游明确响应502。但是在
ngx.balancer
提供的API
get_last_failure
貌似无法区分到底是何种原因导致的502。请教有没有办法区分呢?
如下是测试结果(打印了变量ngx.var.upstream_status, 都是502):
图1: 上游1234端口不通
图2: 上游80端口明确响应502页面