1

I have a ubuntu server which has nginx 1.12.0 installed and i want to completely remove the server Response header

Server:nginx

If i install nginx-extras it will install the nginx/1.1.19 version and it will also disable the Etags,Are there any other options to remove the server header

yagmoth555
  • 16,300
  • 4
  • 26
  • 48
Sam Hams
  • 119
  • 1
  • 2

1 Answers1

0

Add this server_tokens off; on your nginx.conf under server section.

This will remove the Server: nginx 1.12.0 server header

Update:

You need to compile it from source. Here's the link I got from DO.

Download the nginx package then follow this steps:

cd ~/src/nginx/
vi +49 src/http/ngx_http_header_filter_module.c

Find the lines:

static char ngx_http_server_string[] = "Server: nginx" CRLF;
static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;

Modify to:

static char ngx_http_server_string[] = "Server: custom-server-name" CRLF;
static char ngx_http_server_full_string[] = "Server: custom-server-name" CRLF;

This