Skip to content

Instantly share code, notes, and snippets.

@SeyedMostafaAhmadi
Created October 20, 2021 16:52
Show Gist options
  • Save SeyedMostafaAhmadi/9b539ceb9727978afc9ee95eb7aca4a1 to your computer and use it in GitHub Desktop.
Save SeyedMostafaAhmadi/9b539ceb9727978afc9ee95eb7aca4a1 to your computer and use it in GitHub Desktop.
Hide View Server Header Information
# We can stop outputting the version of nginx and os by adding below command in nginx config in /etc/ngingx/nginx.conf to a http, server, or location context.
server_tokens off;
# Or if we want to remove the Server header completely, We need to compile Nginx with the Headers More module in, as the header is hard coded in the Nginx source, and this module allows changing any http headers.
more_clear_headers Server;
# for use top module we should install "apt install nginx-extras"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment