Skip to content

Cannot expose NGF readiness probe (/readyz on 8081) through Gateway Service for Azure Application Gateway health checks. #4400

@avi1512

Description

@avi1512

Describe the bug

We are running NGINX Gateway Fabric (NGF) on an AKS cluster behind an Azure Application Gateway (AppGW).
NGF is deployed with an internal LoadBalancer Service, whose IP is added to AppGW as a backend.

AppGW requires an HTTP health probe. We attempted to use NGF’s built-in readiness endpoint:

  • Path: /readyz
  • Port: 8081 (hardcoded probe port inside NGF container)

NGF exposes only port 80 at the Service level, so attempts to expose 8081 via:

  • Gateway listeners
  • Service ports
  • Helm chart overrides
  • NginxProxy configuration

all result in NGF becoming Unready, and readiness probes fail with HTTP 404.

NGF logs show:

[warn] conflicting server name "" on 0.0.0.0:8081, ignored
[warn] conflicting server name "" on [::]:8081, ignored 

Additionally, when attempting to re-expose 8081, NGF and the container logs repeated 404s:

[warn] conflicting server name "" on 0.0.0.0:8081, ignored

"GET /readyz HTTP/1.1" 404 146 "-" "kube-probe/1.33"

This makes it impossible to configure Application Gateway health probes for NGF.


To Reproduce

Deploy NGF (2.2.1) on AKS.

Attempt to expose readiness probe via Gateway:

listeners:
  - name: health
    port: 8081
    protocol: HTTP

NGF readiness probe fails with HTTP 404.

Logs show:

conflicting server name "" on 0.0.0.0:8081, ignored

Azure Application Gateway marks backend as Unhealthy.

Expected behavior

We expect one of the following to work:

NGF allows exposing its internal readiness endpoint (/readyz on 8081) via:

  • Gateway listeners

  • Service ports

  • Helm configuration

NGF provides a documented, stable health endpoint on the Service load balancer (e.g., /healthz on port 80), similar to other ingress controllers. The readiness probe port becomes configurable, so users can align it with Azure health probe requirements. Currently, none of these options work.


Your environment

NGF version: 2.2.1

Kubernetes: AKS 1.33

Platform: AKS behind Azure Application Gateway

Exposure: Internal LoadBalancer Service

NGINX container logs (excerpt):

time=2025-12-04T18:11:11.790Z level=INFO msg="NGINX config tested" output="2025/12/04 18:11:11 [notice] 34#34: js vm init njs: 00007FDC5C23DC80\n2025/12/04 18:11:11 [warn] 34#34: conflicting server name \"\" on 0.0.0.0:8081, ignored\nnginx: [warn] conflicting server name \"\" on 0.0.0.0:8081, ignored\n2025/12/04 18:11:11 [warn] 34#34: conflicting server name \"\" on [::]:8081, ignored\nnginx: [warn] conflicting server name \"\" on [::]:8081, ignored\nnginx: the configuration file /etc/nginx/nginx.conf syntax is ok\nnginx: configuration file /etc/nginx/nginx.conf test is successful\n" correlation_id=6d69e1ce-36c3-4641-bfec-f292246ca83f server_type=command
time=2025-12-04T18:11:11.790Z level=INFO msg="Reloading NGINX PID" pid=8 correlation_id=6d69e1ce-36c3-4641-bfec-f292246ca83f server_type=command
2025/12/04 18:11:11 [notice] 8#8: signal 1 (SIGHUP) received from 18, reconfiguring
time=2025-12-04T18:11:11.791Z level=INFO msg="No NGINX error logs found to monitor" correlation_id=6d69e1ce-36c3-4641-bfec-f292246ca83f server_type=command
2025/12/04 18:11:11 [notice] 8#8: reconfiguring
2025/12/04 18:11:11 [notice] 8#8: js vm init njs: 00007F87FA17AA00
2025/12/04 18:11:11 [warn] 8#8: conflicting server name "" on 0.0.0.0:8081, ignored
2025/12/04 18:11:11 [warn] 8#8: conflicting server name "" on [::]:8081, ignored
10.21.144.255 - - [04/Dec/2025:18:11:16 +0000] "GET /readyz HTTP/1.1" 404 146 "-" "kube-probe/1.33"
10.21.144.255 - - [04/Dec/2025:18:11:26 +0000] "GET /readyz HTTP/1.1" 404 146 "-" "kube-probe/1.33"
10.21.144.255 - - [04/Dec/2025:18:11:36 +0000] "GET /readyz HTTP/1.1" 404 146 "-" "kube-probe/1.33"

NGINX config excerpt from NGF container:

server {
    listen 8081;
    location = /readyz {
        return 200;
    }
}



Additional context

#3629

We also attempted to use the new custom readinessProbe port feature (introduced by PR #3629) by modifying the NGF Helm chart to set the readiness probe port to 8082.

Example from the generated NginxProxy resource:

readinessProbe:
  initialDelaySeconds: 5
  port: 8082

The NGF Pod initially starts correctly and shows the updated readiness probe:

Readiness: http-get http://:8082/readyz

However, as soon as we expose port 8082 externally (either via a Gateway listener, Kubernetes Service port, or App Gateway probe), the NGF Pod becomes unhealthy, and readiness fails with 404 Not Found, identical to the behavior on port 8081.

NGF logs show the same conflict warnings but now on port 8082:

2025/12/04 18:11:11 [warn] 8#8: conflicting server name "" on 0.0.0.0:8082, ignored
2025/12/04 18:11:11 [warn] 8#8: conflicting server name "" on [::]:8082, ignored

Followed by repeated 404s for the readiness probe:

"GET /readyz HTTP/1.1" 404 "-" "kube-probe/1.33"

So even with a custom readiness probe port, NGF still will not serve /readyz once the port is exposed outside the Pod, and the Pod falls into a crash loop:

Readiness probe failed: HTTP probe failed with statuscode: 404

This confirms:

The issue is not limited to 8081

Any readiness probe port exposed through a Service or listener results in port conflict warnings and NGF failing readiness

/readyz is not reliably reachable through any externally exposed port, even when configured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions