This is not rocket science, but there are a few tips that may save you time if you need to gather information from the http headers. In this post I will show you 3 ways to get the web server headers of any site. But first, it’s always good to know what are the http headers.
What are HTTP Headers?
HTTP means “Hypertext Transfer Protocol”, all the websites in the world are using this protocol since the early 1990′s. It has been one of the most used internet protocols and almost everything you see in your web browser is transmitted to your PC over HTTP. Every time you open Nginxtips.com your browser probably have sent and recieved lot of HTTP requests. The http headers are part of the core of these HTTP requests, and they storage information about the client browser, the web server you are using, the page you requested, and much more.
How can I see the HTTP Headers?
Using a webpage: you can use http://web-sniffer.net/ for example and it will provide an easy/fast interface to check out the headers of any web page. On this example I checked out http://nginxtips.com and this was the result:
Status: HTTP/1.1 301 Moved Permanently Server:nginx Date:Fri, 17 Jan 2014 08:54:20 GMT Content-Type:text/html; charset=UTF-8 Transfer-Encoding:chunked Connection:close X-Pingback:http://www.scalescale.com/tips/nginx/xmlrpc.php Location:http://www.scalescale.com/tips/nginx/
Using the Linux shell: this is my favourite method as it doesn’t require any additional software, it’s fast and works on every system that has curl installed. I’m talking about fetching the headers using curl -I. Live example:
[webtech@localhost ~]$ curl -I http://www.scalescale.com/tips/nginx HTTP/1.1 200 OK Server: nginx Date: Fri, 17 Jan 2014 08:43:44 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Last-Modified: Fri, 17 Jan 2014 08:38:45 GMT Vary: X-Pingback: http://www.scalescale.com/tips/nginx/xmlrpc.php
HTTP Headers explained
On the last example (the one using curl) we got a few fields from the result, let me give you a brief explanation of each one of them:
- HTTP/1.1 200 OK: the http protocol version and the requst result number you got: 200 means the request was ok and you found a valid response from the web server.
- Server: this shows you the web server name you are running in your system.
- Date: the exact date and time when you did the http headers check.
- Content-Type: the MIME type of the body of the request (used with POST and PUT requests).
- Connection: the type of connection that is serving your request from the web server.
- Last-Modified: last modified date for the requested object
- Vary: specifies to downstream proxies how they should match future request headers in order to decide whether the cached response can be used rather than requesting a fresh one from the origin server.
- X-Pingback: the assigned value is an url that allows other sites to track linking between sites.
That’s all! Now you know more about the http headers and three easy ways to check for them.
Popular search terms:
- check server headers
- nginx check header
- nginx print all headers
- check http headers