VMWare Workstation and Windows 10: can't connect to a server hosted on VM

Solution 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- http://192.168.44.136 -H 'Host: test.xxx.com'

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

Invoke-WebRequest -Uri http://127.0.0.1 -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:

  • ModHeader for Chrome/Chromium
  • Modify Header Value for Firefox