Aug 192010

Edit nginx.h

$ vi src/core/nginx.h

find lines:

#define NGINX_VERSION    "0.7.64"
#define NGINX_VER        "nginx/" NGINX_VERSION

Change them as follows:

#define NGINX_VERSION    "0.7.64"
#define NGINX_VER        "kutukupret/" NGINX_VERSION

Save and close the file. Now, you can compile the server. Add the following in nginx.conf to turn off nginx version number displayed on all auto generated error pages:

server_tokens off

Above hack doesn’t work here’s the good one:
edit src/http/ngx_http_header_filter_module.c

around line 48, changing the following line to something like:

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

  3 Responses to “Change Nginx Version Header”

Comments (3)
  1. Usualy i installed Nginx via yum but to follow this tutorial, i installed it manualy. The problem now is nginx wouldn’t start automaticaly after rebooting. Please help..

  2. if you’re on redhat based like init script, just run this command from shell:

    # chkconfig nginx on

    make sure nginx is autostart:

    # chkconfig --list nginx
    nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off

    start nginx manually

    # service nginx start

    stop nginx manually

    # service nginx stop
  3. Ok thanks bro, udah bisa Server saya centos.
    Makasih banget

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>