How do server headers work?
When you visit a website, your web browser sends a request to the server hosting the website. The server then responds with an HTTP response. It consists of a set of header lines, the so-called HTTP headers, and usually a body such as an HTML file. The headers are sent before the actual content. One of these headers is the server header, which provides the browser with information about the server itself and the software it is using. The information in the server header can reveal a lot. For example, based on this information, it is possible to determine what type of server software the host is using, what operating system is running, and whether the server may be vulnerable to certain types of attacks.
Why are server headers important?
Server headers matter above all for website security. A server header with a detailed version number (for example “Apache/2.4.1 (Unix)”) can give attackers clues as to whether the server is vulnerable to known security flaws. It is therefore advisable to hide the version information, for example with “ServerTokens Prod” on the Apache web server or “server_tokens off” on nginx. Keeping the server software up to date remains more important, however.
What information is included in the server header?
The information included in the server header can vary depending on the server and configuration. However, it typically contains basic information such as the name and version of the server software as well as the name of the operating system. In some cases, the server header may also contain additional information, such as the name of the hosting company.
How can I check the server header of my website?
To check what your server header reveals, open your browser’s developer tools, switch to the “Network” tab and reload the page. Then click on the first request, the HTML document. The “Headers” tab shows the server’s response headers, including the server header. On the command line, curl -I followed by your address shows the same information, for example curl -I https://www.example.com.
