Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

接口获取不到upstream 名称等信息 #133

Open
zhubingbi opened this issue Oct 16, 2019 · 1 comment
Open

接口获取不到upstream 名称等信息 #133

zhubingbi opened this issue Oct 16, 2019 · 1 comment

Comments

@zhubingbi
Copy link

location中没有写
session_sticky_hide_cookie 会导致list 接口获取不到upstream信息?

我的配置如下:
location ^~ /bankaccountexterws/ {
#session_sticky_hide_cookie upstream=bankaccountexterws_backend_backend
add_header X-From $short_address$1;
access_log logs/market.access.log main;
error_log logs/market.error.log;
proxy_pass http://bankaccountexterws_backend/bankaccountexterws/;
}

upstream bankaccountexterws_backend {
server 172.22.145.96:9981 weight=1;
server 172.22.154.41:9981 weight=1;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_keepalive_requests 100;
check_http_send "HEAD /test/api/index HTTP/1.1\r\nConnection: keep-alive\r\nHost: baidu.com\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;

session_sticky cookie=ngx-bankaccountexterws path=/bankaccountexterws mode=insert fallback=on option=indirect;

}

在location 配置中解开 session_sticky_hide_cookie 的注释,就能获取到upstream,但是注释掉了的话就获取不到upstream了。

这让我觉得很疑惑...

@zhubingbi
Copy link
Author

解决方案是用作者文档中的set 变量的方式。
但是很奇怪的是,为什么我在不设置变量但是有 session_sticky_hide_cookie 配置的时候也能获取到upstream信息呢?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant