Nginx on CentOS: How to change the “Server” header

centosheadershttphttp-headersnginx

I'm running Nginx on Centos6.

For security reasons I'd like to change/remove the Server HTTP header contained in the response headers.

For instance,nginx's default Sever header looks like:I'm running Nginx on Centos6.

For security reasons I'd like to ch
Server: nginx/1.12.2
But I'd like it to show something like:
Server: mystartup/1.0.
I tried these site confiurations, but none have worked.

server_tokens off;
proxy_pass_header 'New Server Name';

My server configuration:
CentOS 6.9
Nginx version 1.12.2

Best Answer

You probably want add_header Server "mystartup/1.0" always.