Skip to content

Instantly share code, notes, and snippets.

@aamishbaloch
Last active October 23, 2025 11:56
Show Gist options
  • Select an option

  • Save aamishbaloch/1031e7490d7d57d55baff57fce8d2997 to your computer and use it in GitHub Desktop.

Select an option

Save aamishbaloch/1031e7490d7d57d55baff57fce8d2997 to your computer and use it in GitHub Desktop.
Remove Server Details from Response Header - Nginx

Remove Server Details from Response Header - Nginx

Below mentioned method is used to hide or remove the NGIX details from the header of your http requests.

Install Nginx Extras

sudo apt-get update
sudo apt-get install nginx-extras

Remove Server Details

Server details can be removed from response by adding following two lines in the nginx.conf (under http section)

more_clear_headers Server;
server_tokens off;
@ersin-demirtas
Copy link

Just to inform even if you disable the Server header response the hard coded nginx responses will still include nginx. For example majority of the application I work on have the .htaccess usually devs protected this file. Just as an example if you visit that protected file you will see that nginx is returning nginx in the response :D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment