In this tutorial, I will explain to you how to delete the header server on Nginx but not only…
As you can see in the screenshot below, in the response, we can see the server: Microsoft-IIS/8.5 and the version of PHP and ASP with the X-Powered-By headers.
![](https://rdr-it.io/wp-content/uploads/2021/06/nginx-remove-header-2-449x400.png)
To remove the server header, we will use the module http-headers-more-filter
.
Check that the module is present:
nginx -V 2>&1 | grep --color 'http-headers-more-filter'
![](https://rdr-it.io/wp-content/uploads/2021/06/nginx-remove-header-1-600x84.png)
To remove headers, add the following instructions to the virtualhost configuration to remove the information in the server{} block.
more_clear_headers Server;
more_clear_headers X-Powered-By;
![](https://rdr-it.io/wp-content/uploads/2021/06/nginx-remove-header-3-600x314.png)
Save the configuration and reload the configuration.
sudo systemctl reload nginx
Now server and X-Powered-By information is no longer sent to the client.
![](https://rdr-it.io/wp-content/uploads/2021/06/nginx-remove-header-4-452x400.png)
Why remove the server and X-Powered-By headers?
The answer is quite simple, it is to reduce the information you send over the Internet so as not to reveal to “hackers” the type of web server and operating system, which helps reduce the risk of exploitation. ‘a flaw especially if the server and components are not up to date.