Deployed the NGINX Ingress controller and the load balancer IP works, but I always get a “404 Not Found” error — how can I figure out what’s wrong?

Haze Rowald 20 Reputation points
2025-12-10T09:29:55.24+00:00

I have two questions that I need to ask.

  1. How can I check if my Ingress rules (host and path) match the request that’s coming in?
  2. How do I confirm that the NGINX Ingress Controller is actually running and listening on the right ports (80 and 443)?
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shraddha Pandey 385 Reputation points Microsoft External Staff Moderator
    2025-12-10T09:31:37.5333333+00:00

    Hey Haze!

    It sounds like you’re facing some challenges with your NGINX Ingress controller setup, especially with the “404 Not Found” error. Let’s break down your questions and potential solutions:

    1. Checking Ingress Rules

    To check if your Ingress rules (host and path) match the incoming request, you can use the following command:

    
    kubectl describe ingress <your-ingress-resource-name> -n <your-namespace>
    
    

    Look for the rules section in the output to ensure that your hosts and paths are correctly defined. You can also verify that the hostname in your request matches what’s specified in the Ingress resource.

    2. Confirming NGINX Ingress Controller Status

    To confirm that the NGINX Ingress Controller is running and listening on the correct ports (80 and 443), follow these steps:

    1. Check Pods:
      
         kubectl get pods -n <nginx-namespace>
      
      
      Ensure the NGINX ingress controller pod shows a Running status.
    2. Verify Services: Check the services to confirm the controller is exposed correctly:
      
         kubectl get services -n <nginx-namespace>
      
      
      Look for a service with type LoadBalancer, and ensure it has the expected external IP address assigned to it.
    3. Check Logs: Access the logs of the ingress controller pod to identify any errors during startup that might indicate misconfiguration:
      
         kubectl logs <nginx-ingress-pod-name> -n <nginx-namespace>
      
      

    Additional Steps

    • If you're still getting the 404 error after confirming your Ingress and NGINX status, consider testing with a simple app as a sanity check. You can deploy a simple application and set up a basic Ingress rule pointing to it.
    • Ensure that your backend service is running and accessible. You can try connecting to it directly using port-forwarding:
      
         kubectl port-forward svc/<your-backend-service> <local-port>:<service-port> -n <your-namespace>
      
      

    Reference Documentation

    Hope this helps get to the bottom of your issue! Let me know if you have further questions or need more assistance!.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.