The function get_upstreams of the lua-upstream-nginx-module module returns upstream name sometimes with port, sometimes without

15 views
Skip to first unread message

xiaoxi mou

unread,
Mar 28, 2022, 10:29:22 PMMar 28
to openresty-en
Hello

I use the function get_upstreams of the lua-upstream-nginx-module module 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.

My nginx server port is 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

It bothers me.
Need Help.

Thanks.

Junlong li

unread,
Mar 29, 2022, 6:15:58 AMMar 29
to openresty-en

It is so old version of openresty, you should test the newest version of openresty.
and it is better to give a minimal reproducible nginx.conf
Reply all
Reply to author
Forward
0 new messages