Skip to content

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

@xiaoxuanzi

Description

@xiaoxuanzi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions