The HTTP protocol allows the client application (usually a web browser) to create HTTP requests containing the name of the web site it wants to contact; this allows multiple web sites to coexist on the same IP address and port.
All web servers can be configured to serve different contents based on the name of the web site the client is asking for; also, they can have a default web site, which is used if the request doesn't explicitly specify any host name.
In your case, you are (your browser is) contacting the web server without specifying a host name, because you used the server IP address in the URL; it seems like the web server is not configured to handle this type of request, thus it returns an error.
Most web browsers automatically use whatever you specify in the URL as the host name to request (or nothing if you used an IP address); thus you can't control what request is actually being made. Some developer tools allow you to perform custom requests, or you can do them manually by connecting to TCP port 80 on the destination server (even using something as simple as telnet
) and talking a bit of HTTP. For example, this (stripped down) request returns the correct page from the web site example.com:
GET / HTTP/1.1
Host: example.com
It basically means "give me the contents at the path /
(the web site root) for the site called example.com
".