Cloud and Platform SRE7 min read

The 404 That Wasn't a Kong Issue: Debugging a Stale Reverse Proxy Mapping

An SRE incident investigation into Internal Portal returning 404 after an NGINX-to-Kong migration, tracing the issue to a stale Edge Proxy reverse proxy mapping.

observed StatusHTTP 404 Not Found
direct Endpoint StatusHTTP/2 403 (Unauthenticated)
migration ScopeNGINX to Kong API Gateway
resolutionUpstream Edge Proxy reverse proxy destination alignment

After Internal Portal migrated from NGINX to Kong, the application returned 404 through its Edge Proxy URL because Edge Proxy was still configured to forward requests to the decommissioned NGINX endpoint. Direct requests to the new Kong endpoint responded correctly with HTTP 403, proving the gateway route was operational.

Key takeaways

  • API gateway migrations require end-to-end routing updates across all upstream proxies.
  • An HTTP 403 on an unauthenticated direct curl proves route existence when auth is required.
  • Verify upstream routing mappings before debugging healthy backend Kubernetes services.

Quick facts

  • Edge Proxy URL returned 404 due to stale upstream proxy mapping pointing to the old NGINX endpoint.
  • Direct curl to the new Kong endpoint returned HTTP 403, proving Kong routing was functioning.
  • The root cause was isolated to upstream reverse proxy routing rather than the Kong ingress controller.

1. Incident Overview

A migration from one ingress or API gateway to another does not end when the new gateway is deployed and its routes are configured.

Every upstream system that forwards traffic to the application must also be updated.

This became apparent during the Internal Portal migration from NGINX to Kong.

After the migration, users accessing Internal Portal through its existing Edge Proxy URL encountered:

TEXT
404 Not Found

The initial suspicion naturally fell on the newly introduced Kong configuration. However, direct testing of the new Kong endpoint showed that it was reachable.

The investigation eventually identified a different problem: Edge Proxy was still forwarding requests to the old NGINX endpoint rather than the new Kong endpoint.

The Kong migration itself was not the component that needed correction. The missing piece was the upstream reverse proxy mapping.

Incident metadata

AttributeDetails
ApplicationInternal Portal
EnvironmentPROD
Regioneu-central-1
Namespaceportal-app
MigrationNGINX to Kong
User-facing symptomHTTP 404
Existing access pathEdge Proxy
New gatewayKong
Confirmed causeEdge Proxy mapped to the old NGINX URL

2. Understanding the Architecture

Before investigating the error, it is important to understand the request path.

Internal Portal was accessed through an established Edge Proxy URL:

TEXT
https://portal.example.com/app/

As part of the migration, the application was moved behind a new Kong endpoint:

TEXT
https://portal-app.prod.gateway.example.com/app/

The application endpoint had changed, but the existing user-facing URL was expected to continue working.

That meant Edge Proxy needed to forward incoming requests to the new Kong endpoint.

The architecture should have looked like this:

Technical Architecture FlowMermaid.js
Rendering architectural diagram...
Diagram source
flowchart TD
    A["User / Browser"] --> B["Edge Proxy URL"]
    B --> C["Upstream Reverse Proxy"]
    C --> D["New Kong Endpoint"]
    D --> E["Kong Route"]
    E --> F["Internal Portal Kubernetes Service"]
    F --> G["Internal Portal Pod"]

    classDef user fill:#dbeafe,stroke:#2563eb,color:#111827
    classDef proxy fill:#fef3c7,stroke:#d97706,color:#111827
    classDef backend fill:#dcfce7,stroke:#16a34a,color:#111827

    class A,B user
    class C,D,E proxy
    class F,G backend
Figure 1: Internal Portal Stale Edge Proxy Mapping Architecture and Investigation Boundary
Download .excalidrawExcalidraw Vector
Internal Portal: stale Edge Proxy mapping after NGINX → Kong migrationRequest routing investigation — observed responses and configuration boundaryUser / BrowserEdge Proxy URL/app/Edge ProxyReverse proxy / URL mappingOld NGINX endpointStale destinationNew Kong endpointInternal Portal routeObserved mappingExpected targetEdge Proxy URL returned 302(authentication redirect)Direct Kong request returned 403without authenticationEvidence• Edge Proxy path: HTTP 302 to corporate SSO• Direct Kong path: HTTP/2 403 unauthenticated• Kong-side route/config verifiedRCA conclusionEdge Proxy remained mapped to the old NGINX URLinstead of the new Kong endpoint.Update the upstream mapping and validate auth.A 403 from the direct endpoint is not proof of a broken route when authentication is required.
  • Internal Portal: stale Edge Proxy mapping after NGINX → Kong migration
  • Request routing investigation — observed responses and configuration boundary
  • User / Browser Edge Proxy URL /app/
  • Edge Proxy Reverse proxy / URL mapping
  • Old NGINX endpoint Stale destination
  • New Kong endpoint Internal Portal route
  • Observed mapping
  • Expected target
  • Edge Proxy URL returned 302 (authentication redirect)
  • Direct Kong request returned 403 without authentication
  • Evidence
  • • Edge Proxy path: HTTP 302 to corporate SSO • Direct Kong path: HTTP/2 403 unauthenticated • Kong-side route/config verified
  • RCA conclusion
  • Edge Proxy remained mapped to the old NGINX URL instead of the new Kong endpoint. Update the upstream mapping and validate auth.
  • A 403 from the direct endpoint is not proof of a broken route when authentication is required.

The problem was that the actual Edge Proxy mapping had not followed the migration.

3. Initial Symptoms

The first indication was straightforward:

TEXT
https://portal.example.com/app/

returned:

TEXT
404 Not Found

At this stage, several components could potentially have been responsible:

  • Edge Proxy reverse proxy configuration.
  • Kong route configuration.
  • Kubernetes Ingress or gateway routing.
  • Kubernetes Service configuration.
  • Application context path.
  • Authentication or authorization handling.

Rather than immediately modifying Kong, the investigation separated the two access paths:

  1. Access through the existing Edge Proxy URL.
  2. Access directly through the new Kong endpoint.

This distinction was important because it allowed the gateway to be tested independently of the upstream reverse proxy.

4. Investigation: Testing Both Endpoints

Step 1: Test the existing Edge Proxy URL

The first test was against the URL users normally accessed.

BASH
curl -I -v \
  https://portal.example.com/app/

The response showed:

TEXT
HTTP/1.1 302 Found

The response redirected the request to the corporate SSO endpoint.

A redirect is not the same as a successful application response. It indicates that the request was redirected to another URL.

This observation provided useful information about the authentication flow, but it did not prove that Edge Proxy was forwarding traffic to the correct application endpoint.

Step 2: Test the new Kong endpoint directly

The next step was to bypass Edge Proxy and test the new Kong URL.

BASH
curl -I -v \
  https://portal-app.prod.gateway.example.com/app/

The response was:

TEXT
HTTP/2 403

At first glance, a 403 may look like another application failure.

However, this response was returned by a direct request without the required authentication context.

A 403 response means the server understood the request but refused to authorize it.

The important distinction was that the new Kong endpoint was reachable and responding.

It did not establish that an unauthenticated request should be allowed to access the application.

Step 3: Interpret the responses correctly

Request pathObserved responseInterpretation
Edge Proxy URLHTTP 302Redirect to corporate SSO
Direct Kong URLHTTP/2 403Endpoint responding; unauthenticated access denied
Expected application behaviorAuthenticated application responseRequires validation with the correct authentication context

This is a useful troubleshooting lesson:

HTTP status codes must be interpreted in the context of the request path and authentication state.

A 403 from an unauthenticated direct request does not automatically indicate a broken Kong route.

5. Validate Kong and Kubernetes Configuration

Since the direct Kong endpoint was reachable, the next step was to verify that the Kubernetes-side configuration matched the migration design.

The investigation checked the relevant resources in the portal-app namespace.

Check Ingress resources

BASH
kubectl get ingress -n portal-app

Inspect the relevant resource:

BASH
kubectl get ingress <ingress-name> \
  -n portal-app -o yaml

Check ConfigMaps

BASH
kubectl get configmap -n portal-app

Inspect the relevant configuration:

BASH
kubectl get configmap <configmap-name> \
  -n portal-app -o yaml

Check Services

BASH
kubectl get svc -n portal-app

Inspect the application Service:

BASH
kubectl get svc <service-name> \
  -n portal-app -o yaml

The purpose of these checks was to verify:

  • The expected Kong routing configuration existed.
  • The application path was configured.
  • The Service referenced the correct application backend.
  • The Kubernetes-side configuration reflected the new endpoint.

The Kong-side configuration was verified and found to be correctly configured for the new endpoint.

This reduced the likelihood that the 404 originated from a missing or incorrectly configured Kong route.

Once the new Kong endpoint and its Kubernetes configuration had been verified, attention shifted to the component sitting in front of it.

Edge Proxy was responsible for preserving the existing user-facing URL while forwarding traffic to the application.

The migration had changed the backend gateway, but the Edge Proxy mapping still referenced the previous NGINX endpoint.

Conceptually, the stale mapping looked like this:

TEXT
Edge Proxy
  |
  v
Old NGINX endpoint
  |
  v
Previous Internal Portal routing path

The expected mapping was:

TEXT
Edge Proxy
  |
  v
New Kong endpoint
  |
  v
Internal Portal route

This explained why validating Kong directly was not enough.

The direct endpoint and the user-facing endpoint were two different request paths, with Edge Proxy acting as an additional routing dependency.

Actual versus expected request path

Technical Architecture FlowMermaid.js
Rendering architectural diagram...
Diagram source
flowchart TD
    A["User accesses Edge Proxy URL"] --> B["Upstream Reverse Proxy"]

    B --> C["Old NGINX endpoint"]
    C --> D["Stale routing destination"]
    D --> E["404 Not Found"]

    B -. "Expected mapping after migration" .-> F["New Kong endpoint"]
    F --> G["Kong route"]
    G --> H["Internal Portal Service"]
    H --> I["Internal Portal application"]

    classDef error fill:#fee2e2,stroke:#dc2626,color:#111827
    classDef expected fill:#dcfce7,stroke:#16a34a,color:#111827

    class C,D,E error
    class F,G,H,I expected

The issue was not that Kong could not route to Internal Portal. It was that the established upstream entry point had not been updated to use Kong.

7. Root Cause Analysis

Root cause

Edge Proxy retained the old NGINX destination after the Internal Portal migration to Kong.

As a result, requests made through the existing Edge Proxy URL were not routed to the new Kong endpoint.

The new Kong endpoint was independently reachable, and its Kubernetes-side configuration was verified.

Contributing factor

The migration validation focused on the new Kong endpoint and its internal routing configuration.

However, the upstream reverse proxy mapping was also part of the end-to-end application access path.

A gateway migration is incomplete until every upstream dependency is updated or intentionally redirected.

Why the initial symptoms were misleading

There were two different HTTP responses during the investigation:

  • The Edge Proxy URL returned a 302 authentication redirect.
  • The direct Kong endpoint returned HTTP/2 403 without authentication.

Neither response alone established the routing problem.

The decisive finding came from validating the Edge Proxy destination mapping against the new Kong endpoint.

8. Remediation

The required correction was to update the Edge Proxy reverse proxy mapping so that the existing application URL forwarded requests to the new Kong endpoint.

Expected destination:

TEXT
https://portal-app.prod.gateway.example.com/app/

The remediation should include:

  1. Update the Edge Proxy upstream destination.
  2. Remove the stale NGINX endpoint reference from the active mapping.
  3. Validate the configured path and trailing-slash behavior.
  4. Verify the authentication flow through the existing Edge Proxy URL.
  5. Test the application using an authenticated session.
  6. Confirm that the request reaches the expected Kong route and backend Service.

The existing Edge Proxy URL should remain the user-facing entry point if that is the intended application architecture.

The goal is to change the upstream destination without unnecessarily changing the URL used by end users.

9. Post-Fix Validation Checklist

A successful configuration update should be validated end to end.

ValidationExpected outcome
Edge Proxy URLReaches the intended authentication flow
Authenticationcorporate SSO completes successfully
Edge Proxy upstreamPoints to the new Kong endpoint
Kong routeMatches /app/
Kubernetes ServiceRoutes to the expected backend
ApplicationInternal Portal loads successfully
Old NGINX mappingNo longer used by the active Edge Proxy route
LogsRequest can be correlated across proxy and gateway layers

A direct unauthenticated curl request returning 403 should not be treated as a failed validation if the application intentionally requires authentication.

Use an authorized test session or the approved authentication mechanism to validate the complete user journey.

10. Lessons for Platform Engineering and SRE

1. Gateway migrations involve more than the gateway

When replacing NGINX with Kong, upstream reverse proxies, DNS records, application routing, authentication integrations, and monitoring must all be considered.

2. Test the complete request path

Testing the new gateway directly is useful, but it does not validate the existing user-facing URL.

Both paths must be checked.

3. Understand HTTP status codes before troubleshooting

A 302 redirect, 403 authorization response, and 404 routing response represent different behaviors.

Treating every non-200 response as the same failure can send an investigation in the wrong direction.

4. Validate external dependencies during migration

The application may be healthy, the new gateway may be correctly configured, and Kubernetes Services may be working — yet users can still experience an outage because an upstream system has stale configuration.

5. Keep migration checklists end to end

A production migration checklist should explicitly include:

  • New gateway route validation.
  • Upstream reverse proxy updates.
  • Authentication and authorization validation.
  • Existing URL compatibility.
  • Application backend connectivity.
  • Rollback destination.
  • End-to-end smoke testing.

11. Final Takeaway

This incident demonstrates why troubleshooting should follow the actual request path rather than focusing only on the component that was recently changed.

Kong was deployed and its routing configuration was verified. The application endpoint was reachable.

The failure occurred because Edge Proxy continued to use the old NGINX destination.

The lesson: a gateway migration is only complete when every upstream system knows where the new gateway is.

Continue reading

Related dispatches across technical domains.