By default, Nginx and Apache versions are displayed when you query HTTP headers. Website security is very important for any system or website administrator. For security reasons, it is recommended to hide the Nginx and Apache versions to make it harder for attackers to know what vulnerabilities can be exploited on your server.
In this post, we will show you how to hide Apache and Nginx versions on Oracle Linux 10.
Step 1 – Verify Apache and Nginx Header Details
By default, Apache and Nginx will show the version on error pages and in the response header. You can check it using the CURL command:
curl --head http://localhost
You should see the Apache version information in the following output:
Date: Sat, 06 Dec 2025 08:49:45 GMT Server: Apache/2.4.63 (Oracle Linux Server) Last-Modified: Tue, 02 Sep 2025 00:00:00 GMT ETag: "dd3-63dc62b53e000" Accept-Ranges: bytes Content-Length: 3539 Content-Type: text/html; charset=UTF-8
To check the Nginx version information, run the following command:
curl --head http://localhost
You should see the Nginx version details in the following output:
Server: nginx/1.26.3 Date: Sat, 06 Dec 2025 08:49:14 GMT Content-Type: text/html Content-Length: 153 Connection: keep-alive
Step 2 – Hide Apache Version
To hide the Apache version, you will need to edit the Apache configuration file and add the line “ServerTokens Prod”:
nano /etc/httpd/conf/httpd.conf
Add the following line at the end of the file:
ServerTokens Prod
Save and close the file, then restart the Apache service to apply the changes:
systemctl restart httpd
Next, check the Apache header using the following command:
curl --head http://localhost
You should see that there is no version shown:
Date: Sat, 06 Dec 2025 08:50:55 GMT Server: Apache Last-Modified: Tue, 02 Sep 2025 00:00:00 GMT ETag: "dd3-63dc62b53e000" Accept-Ranges: bytes Content-Length: 3539 Content-Type: text/html; charset=UTF-8
Step 3 – Hide Nginx Version
To hide the Nginx version, you will need to edit the Nginx configuration file and add the line “server_tokens off”:
nano /etc/nginx/nginx.conf
Add the following line after http {:
server_tokens off;
Save and close the file, then restart the Nginx service to apply the changes:
systemctl restart nginx
Next, check the Nginx header using the following command:
curl --head http://localhost
You should see that there is no version shown:
Server: nginx Date: Sat, 06 Dec 2025 08:51:57 GMT Content-Type: text/html Content-Length: 146 Connection: keep-alive
Conclusion
In this tutorial, we explained how to hide the Apache and Nginx version on Oracle Linux 10. Hiding the Apache and Nginx version is one of the methods to protect your web server. You can now easily hide your Apache and Nginx versions in the production environment. Try it on dedicated hosting from Atlantic.Net!