diff --git a/cmd/nginx-ingress/main.go b/cmd/nginx-ingress/main.go index 46d85697cd..4c2ed7c032 100644 --- a/cmd/nginx-ingress/main.go +++ b/cmd/nginx-ingress/main.go @@ -110,7 +110,7 @@ var ( nginxStatusAllowCIDRs = flag.String("nginx-status-allow-cidrs", "127.0.0.1", `Whitelist IPv4 IP/CIDR blocks to allow access to NGINX stub_status or the NGINX Plus API. Separate multiple IP/CIDR by commas.`) nginxStatusPort = flag.Int("nginx-status-port", 8080, - "Set the port where the NGINX stub_status or the NGINX Plus API is exposed. [1023 - 65535]") + "Set the port where the NGINX stub_status or the NGINX Plus API is exposed. [1024 - 65535]") nginxStatus = flag.Bool("nginx-status", true, "Enable the NGINX stub_status, or the NGINX Plus API.") @@ -127,7 +127,7 @@ var ( "Enable exposing NGINX or NGINX Plus metrics in the Prometheus format") prometheusMetricsListenPort = flag.Int("prometheus-metrics-listen-port", 9113, - "Set the port where the Prometheus metrics are exposed. [1023 - 65535]") + "Set the port where the Prometheus metrics are exposed. [1024 - 65535]") enableCustomResources = flag.Bool("enable-custom-resources", true, "Enable custom resources") @@ -561,8 +561,8 @@ func validateResourceName(lock string) error { // validatePort makes sure a given port is inside the valid port range for its usage func validatePort(port int) error { - if port < 1023 || port > 65535 { - return fmt.Errorf("port outside of valid port range [1023 - 65535]: %v", port) + if port < 1024 || port > 65535 { + return fmt.Errorf("port outside of valid port range [1024 - 65535]: %v", port) } return nil } diff --git a/cmd/nginx-ingress/main_test.go b/cmd/nginx-ingress/main_test.go index a93abcad87..7bc9ddae40 100644 --- a/cmd/nginx-ingress/main_test.go +++ b/cmd/nginx-ingress/main_test.go @@ -7,7 +7,7 @@ import ( ) func TestValidatePort(t *testing.T) { - badPorts := []int{80, 443, 1, 1022, 65536} + badPorts := []int{80, 443, 1, 1023, 65536} for _, badPort := range badPorts { err := validatePort(badPort) if err == nil { @@ -15,7 +15,7 @@ func TestValidatePort(t *testing.T) { } } - goodPorts := []int{8080, 8081, 8082, 1023, 65535} + goodPorts := []int{8080, 8081, 8082, 1024, 65535} for _, goodPort := range goodPorts { err := validatePort(goodPort) if err != nil { diff --git a/docs-web/configuration/global-configuration/command-line-arguments.md b/docs-web/configuration/global-configuration/command-line-arguments.md index 0649adfdf2..6014627762 100644 --- a/docs-web/configuration/global-configuration/command-line-arguments.md +++ b/docs-web/configuration/global-configuration/command-line-arguments.md @@ -115,7 +115,7 @@ Below we describe the available command-line arguments: Set the port where the NGINX stub_status or the NGINX Plus API is exposed. - Format: ``[1023 - 65535]`` (default 8080) + Format: ``[1024 - 65535]`` (default 8080) .. option:: -proxy @@ -169,7 +169,7 @@ Below we describe the available command-line arguments: Sets the port where the Prometheus metrics are exposed. - Format: ``[1023 - 65535]`` (default 9113) + Format: ``[1024 - 65535]`` (default 9113) .. option:: -spire-agent-address