<p>I'm using <code>HA-Proxy</code> (Independent server) and <code>Kubernetes v1.25.4</code> cluster (One master and three workers) bare metal based.</p>
<p>I have deployed <code>Jenkins</code> and<code>Nginx ingress controller</code> with help of this <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">Link</a>,</p>
<p>But when i tried to access our jenkins URL <code>http://jenkins.company.com/jenkins</code> getting <code>404 Not Found</code> error.</p>
<p><strong>My Jenkins application name space status:-</strong></p>
<pre><code>$ kubectl get all -n jenkins
NAME                           READY   STATUS    RESTARTS      AGE   
pod/jenkins-75cbc954b6-2wfpt   1/1     Running   2 (13d ago)   70d   

NAME                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/jenkins-svc   ClusterIP   10.96.180.240   &lt;none&gt;        80/TCP    70d

NAME                      READY   UP-TO-DATE   AVAILABLE   AGE                           
deployment.apps/jenkins   1/1     1            1           70d   

NAME                                 DESIRED   CURRENT   READY   AGE   
replicaset.apps/jenkins-75cbc954b6   1         1         1       70d   
</code></pre>
<p><strong>Ingress controller status:-</strong></p>
<pre><code>$ kubectl get all -n nginx-ingress
NAME                      READY   STATUS    RESTARTS      AGE
pod/nginx-ingress-5xnz4   1/1     Running   2 (13d ago)   70d
pod/nginx-ingress-h2g9p   1/1     Running   3 (13d ago)   70d
pod/nginx-ingress-jgtc9   1/1     Running   2 (13d ago)   70d

NAME                           DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/nginx-ingress   3         3         3       3            3           &lt;none&gt;          70d
</code></pre>
<p><strong>Ingress pod log:-</strong></p>
<pre><code>$ kubectl logs nginx-ingress-h2g9p -n nginx-ingress
2023/01/09 03:21:33 [notice] 25#25: signal 29 (SIGIO) received
2023/01/09 03:21:33 [notice] 25#25: signal 17 (SIGCHLD) received from 145
2023/01/09 03:21:33 [notice] 25#25: worker process 145 exited with code 0
2023/01/09 03:21:33 [notice] 25#25: worker process 164 exited with code 0
2023/01/09 03:21:33 [notice] 25#25: worker process 178 exited with code 0
2023/01/09 03:21:33 [notice] 25#25: signal 29 (SIGIO) received
</code></pre>
<p><strong>Ingress status:-</strong></p>
<pre><code>$ kubectl get ingress jenkins-ingress -n jenkins
NAME              CLASS   HOSTS                 ADDRESS   PORTS   AGE
jenkins-ingress   nginx   jenkins.company.com             80      63s
</code></pre>
<pre><code>$ kubectl describe ingress jenkins-ingress -n jenkins
Name:             jenkins-ingress
Labels:           &lt;none&gt;
Namespace:        jenkins
Address:
Ingress Class:    nginx
Default backend:  &lt;default&gt;
Rules:
  Host             Path  Backends
  ----             ----  --------
  jenkins.company.com
                   /jenkins   jenkins-svc:80 (10.244.2.19:8080)
Annotations:       nginx.ingress.kubernetes.io/rewrite-target: /$2
Events:
  Type    Reason          Age   From                      Message
  ----    ------          ----  ----                      -------
  Normal  AddedOrUpdated  9m4s  nginx-ingress-controller  Configuration for jenkins/jenkins-ingress was added or updated
  Normal  AddedOrUpdated  9m4s  nginx-ingress-controller  Configuration for jenkins/jenkins-ingress was added or updated
  Normal  AddedOrUpdated  9m4s  nginx-ingress-controller  Configuration for jenkins/jenkins-ingress was added or updated
</code></pre>
<p>Even on Kubernetes cluster master terminal  also <code>curl</code> fails with below errors.</p>
<pre><code>$ curl -D- http://jenkins.company.com/jenkins -v
*   Trying 160.20.21.6...
* TCP_NODELAY set
* Connected to jenkins.company.com (160.20.21.6) port 80 (#0)
&gt; GET /jenkins HTTP/1.1
&gt; Host: jenkins.company.com
&gt; User-Agent: curl/7.58.0
&gt; Accept: */*
&gt;
&lt; HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
&lt; Server: nginx/1.23.2
Server: nginx/1.23.2
&lt; Date: Mon, 09 Jan 2023 02:58:06 GMT
Date: Mon, 09 Jan 2023 02:58:06 GMT
&lt; Content-Type: text/html
Content-Type: text/html
&lt; Content-Length: 153
Content-Length: 153
&lt; Connection: keep-alive
Connection: keep-alive

&lt;
&lt;html&gt;
&lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
&lt;hr&gt;&lt;center&gt;nginx/1.23.2&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
* Connection #0 to host jenkins.company.com left intact
</code></pre>
<p>Please let me know whats wrong with my configurations side?</p>
<p>Any help will be helpful. Thanks in advance.</p>

user4948798
<p>For me its looks, like your request is not reaching to Nginx container itself. so try below mentioned options.</p>
<p>As Nginx-ingress runs as a daemon set, so Nginx container ports 80 and 443 are mapped with the 80 and 443 ports of the host. so you can use http://{node-IP} to connect to Nginx container. You can make use of any node-IP out of 3 nodes. Once the request reaches to Nginx container then it will be routed to the backend container after checking the resource rules that you created. so you can use http//{node-ip}/jenkins to connect to jenkins container.</p>
<p>To test with curl client. may use hostname spoofing.
curl -H &quot;Host: jenkins.company.com&quot; http://{host-ip}/jenkins</p>
