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