对nginx的一个版本进行隐藏,这样你不知道登入的网站到底用的是什么服务器

JFWS/3.0 虚构web服务 虚构版本号

Nginx版本隐藏

/usr/src/nginx-1.16.1/src  --来到src下面,有大量的源码文件

[[email protected] src]# ls

core  event  http  mail  misc  os  stream

[[email protected] core]# cd core

[[email protected] core]# vi nginx.h

这里面定义了版本的信息

#define NGINX_VERSION      "3.0"

#define NGINX_VER          "JFWS/" NGINX_VERSION

 

[[email protected] nginx-1.16.1]# ./configure --prefix=/usr/local/nginx  --预编译

[[email protected] nginx-1.16.1]# make build && make install  --编译并且安装

[[email protected] nginx-1.16.1]# /usr/local/nginx/sbin/nginx  --启动nginx,再去访问就ok了

Nginx版本隐藏

相关文章: