Skip to content

The name returned by get_upstreams is sometimes with a port, sometimes without. #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xiaoxuanzi opened this issue Mar 28, 2022 · 1 comment

Comments

@xiaoxuanzi
Copy link

xiaoxuanzi commented Mar 28, 2022

Hello

I use the function get_upstreams to output all the named upstream groups.
I found a strange situation.
In our online environment, most of the displayed upstream names have port 80, and a few do not have port 80.

I would like to know why this is the case and how to remove the port.

nginx version: openresty/1.11.2.2

upstream test1-pool:80:
    1   addr = 10.18.75.163:1189, weight = 1, fail_timeout = 10, name = 10.18.75.163:11889, max_fails = 1
    2   addr = 10.18.96.47:1189, weight = 1, fail_timeout = 10, backup = true, name = 10.18.96.47:11889, max_fails = 1
	
	
upstream test2-pool:
    1   addr = 10.18.38.32:8080, weight = 1, fail_timeout = 10, backup = true, name = 10.18.38.32:8080, max_fails = 1
    2   addr = 10.16.77.94:8080, weight = 1, fail_timeout = 10, name = 10.16.77.94:8080, max_fails = 1

But in my test environment, there is no port with upstream name
nginx version: openresty/1.11.2.2

@zhuizhuhaomeng
Copy link
Contributor

https://github.com/openresty/lua-upstream-nginx-module/blob/master/t/sanity.t
you can try to add a test case in sanity.t

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

No branches or pull requests

2 participants