<p>Hi I am deploying a flutter based web application into AKS private cluster.
I configured NGINX ingress controller in my cluster and added dns entries for my ingress controller external IP. I configured a route for my service, when i am hitting only DNS name it's loading the application correctly but when i try to refresh it's giving <strong>404 error</strong>.</p>
<p>When i browse &quot;<strong>https://app.myorg.com</strong>&quot; it's redirecting to &quot;**<a href="https://app.myorg.com/dashboard**%22" rel="nofollow noreferrer">https://app.myorg.com/dashboard**&quot;</a></p>
<p>but when i try to hit &quot;**<a href="https://app.myorg.com/dashboard**%22" rel="nofollow noreferrer">https://app.myorg.com/dashboard**&quot;</a> manually it's giving 404 error.
Please help me to resolve this issue.</p>
<p>---------------Here is my pod file---------</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  namespace: web-ns
  labels:
    app: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - name: frontend
        image: frontend:1.5
        imagePullPolicy: Always
</code></pre>
<p>-------------Here is the Service file----------</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: frontend-srv
spec:
  type: ClusterIP
  ports:
  - name: http
    port: 80
  - name: https
    port: 443
  selector:
    app: frontend
</code></pre>
<p>-------------Here is the ingress route file----------</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frontend-ingress
  namespace: web-ns
  annotations:
          kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: app.myorg.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: frontend-srv
            port:
              number: 80
</code></pre>

AjayKumar
<p>You received a <code>404</code> because the ingress controller does not have a route configured for the &quot;<code>/dashboard</code>&quot; path.</p>
<p>From your ingress rules, It'll match only root (<code>/</code>) path. (<code>https://app.myorg.com/</code>)</p>
<p>You can try with the following configuration: (<em><strong>It will be better if you can set specific paths for your ingress controller rules.</strong></em>)</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frontend-ingress
  namespace: web-ns
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - host: app.myorg.com
      http:
        paths:
          - path: /*
            pathType: Prefix
            backend:
              service:
                name: frontend-srv
                port:
                  number: 80
</code></pre>
