小编Lei*_*hao的帖子

NGINX 健康检查需要上游

我有一个位置,如:

location / {
set $api_name "Web";

proxy_intercept_errors on;

set $upstream upstream_a;

if ( $kms_in_cookie != "not_set" ) {
    set $upstream $kms_in_cookie;
}

if ( $upstream_in_cookie != "not_set" ) {
    set $upstream $upstream_in_cookie;
}

if ($cookie_zak != "") {
    set $upstream upstream_b;
}

proxy_pass http://$upstream;

health_check uri=/healthcheck  interval=30 fails=3 passes=3;}
Run Code Online (Sandbox Code Playgroud)

一旦我重新启动我的 NGINX,它就失败了:

nginx: [emerg] health check requires an upstream in
Run Code Online (Sandbox Code Playgroud)

有没有人对此有任何想法?这个错误是什么意思?

nginx nginx-location

5
推荐指数
1
解决办法
655
查看次数

标签 统计

nginx ×1

nginx-location ×1