kong
kong copied to clipboard
proxy_next_upstream don't work
Is there an existing issue for this?
- [X] I have searched the existing issues
Kong version ($ kong version
)
2.6.1&2.5.1
Current Behavior
upstream config
172.23.0.6:9101 response http status 502
172.23.0.6:9102 response http status 200
172.23.0.6:9103 response http status 200
` nginx_kong.lua add proxy_next_upstream and proxy_next_upstream_tries
proxy_next_upstream error timeout http_502 http_503 non_idempotent;
proxy_next_upstream_tries 3;
kong log
2022/07/15 09:25:54 [debug] 1098#0: *920 [lua] init.lua:288: [cluster_events] polling events from: 1657877099.889
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] consistent_hashing.lua:161: getPeer(): [upstream:upstream_test 1] trying to get peer with value to hash: [ca2e47b2-79af-4256-b880-0c9684e281b9]
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:972: balancer(): setting address (try 1): 172.23.0.6:9101
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:1001: balancer(): enabled connection keepalive (pool=172.23.0.6|9101, pool_size=60, idle_timeout=60, max_requests=100)
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] consistent_hashing.lua:161: getPeer(): [upstream:upstream_test 1] trying to get peer with value to hash: [nil]
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:972: balancer(): setting address (try 2): 172.23.0.6:9101
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:1001: balancer(): enabled connection keepalive (pool=172.23.0.6|9101, pool_size=60, idle_timeout=60, max_requests=100)
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] consistent_hashing.lua:161: getPeer(): [upstream:upstream_test 1] trying to get peer with value to hash: [nil]
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:972: balancer(): setting address (try 3): 172.23.0.6:9101
2022/07/15 09:25:55 [debug] 1097#0: *934 [lua] init.lua:1001: balancer(): enabled connection keepalive (pool=172.23.0.6|9101, pool_size=60, idle_timeout=60, max_requests=100)
2022/07/15 09:25:55 [info] 1097#0: *934 client 172.23.0.1 closed keepalive connection
`
Expected Behavior
If kong returns 502, kong should load to the next upstream 172.23.0.6:9102 or 172.23.0.6:9103
Steps To Reproduce
No response
Anything else?
No response
Kong is not using Nginx balancer, so I think that is the reason why this doesn't work.
Kong is not using Nginx balancer, so I think that is the reason why this doesn't work.
Yes, it's definitely dns/balancer problem。But it needs fix. Do you have any good suggestions