I have a private 2 nodes Kubernetes cluster configured on VMWare Workstation 15. I'm using MetalLB and Calico. Ingress service and ingress look like:

xxx@c1-cp1:~/Desktop$ kubectl get svc -n ingress-controller-2
NAME                                         TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                      AGE
wsnginx-ingress-nginx-controller             LoadBalancer   80:30167/TCP,443:30680/TCP   24h
wsnginx-ingress-nginx-controller-admission   ClusterIP   <none>           443/TCP                      24h
xxx@c1-cp1:~/Desktop$ kubectl get ing apollo-ingress
NAME             CLASS     HOSTS                ADDRESS          PORTS   AGE
apollo-ingress   wsnginx   test.xxx.com   80      3h17m

I am using Nat Network Adapter and static IPS. I have port forwarding configured as following

enter image description here

curl -D- -H 'Host: test.xxx.com' from VM, returns 200 status but I cannot manage to access it from host machine Win10 on as I get a 404 NGINX NotFound.

Could you please help me out? what am I doing wrong? How else could I expose it in my private network? Thank you!

UPDATE I am not sure if this is the right way, but I managed to connect from the host machine, by changing a bit the Ingress resource. I put in comments the host parameter, as

apiVersion: networking.k8s.io/v1
kind: Ingress
  name: apollo-ingress
  ingressClassName: wsnginx
    #- host: test.xxx.com
    - http:
          - backend:
                name: apollo-service
                  number: 80
            path: /
            pathType: Prefix

and now my ingress looks like this

NAMESPACE   NAME                                                   CLASS     HOSTS                        ADDRESS          PORTS     AGE
default     ingress.networking.k8s.io/apollo-ingress               wsnginx   *                     80        3h31m

It seems that I can access it now from my host machine as well. I am having a Rest API so I've just opened it from browser

  • Hi Oana welcome to S.F. You didn't include the actual test command for your Win10 example, but for clarity: Ingress resources are entirely host-header virtual hosted, meaning (just as you did with your curl) you must include a host: header so the ingress controller knows how to route your request. Good luck
    – mdaniel
    Dec 7, 2021 at 16:50
  • hi @mdaniel ! thank you :) Well, i was just trying to open it in browser (as there is a REST API) -->; but i made it work in the meantime by removing the host value from ingress manifest rules: #- host: test.xxx.com - http: paths: - backend: service: name: apollo-service port: number: 80 Is this ok?
    – Oana
    Dec 7, 2021 at 18:47

1 Answer 1


This seems like a simple issue of missing HTTP header.

First, short explanaition:
Whenever a Host field is specified in Ingress manifest, only connections from that host will be accepted. This information is extracted form Host HTTP header. If you do not specify Host field in Ingress manifest, requests from all sources will be accepted.

You did sent the request correctly the first time

curl -D- -H 'Host: test.xxx.com'

But forgot to do this the second time.
Powershell equivalent of the above is

Invoke-WebRequest -Uri -Headers @{"Host"="test.xxx.com"}

This is all nice and easy when done from command line, but sending request from web browser is a tad harder. Web broswers does not allow you to modify a request, to include proper Host header, by default. However such functionality can be achieved with extensions:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .