You need to include the domain name in your GET request. You have told
nc the domain name you are connecting to do it knows where to go find the server, but
nc doesn't pass that on to the server. If the server is hosting multiple domains, it will not know which one to send you. The request header you are passing with
echo should include this full domain like this:
echo "GET http://domain.tld/path" | nc domain.tld 80
Note that you can also drop the
-e argument to your echo and the escaped newlines at the end. The
-e is suppressing echo's natural tendency to add a newline, then you are adding one yourself.
Edit 1: Is there some reason you are not using a normal download tool like
curl that can handle all the header possibilities and give you useful output? Do you really need to handle the header chat yourself?
curl http://domain.tld/path should give you much more reliable output because the programmers have already worked through all the possibilities for you.
Edit 2: See Warren's answer for information about the protocol specification. TL;DR: If you specify 1.1, you have to then comply with that protocal. If you pecify 1.0, you can usually make the reqest as above.
The make a requestion with echo and netcat using HTTP/1.1, try this:
echo "GET http://domain.tld/path HTTP/1.1\nHost: domain.tld\n" | nc domain.tld 80