Nginx版本隱藏

對nginx的一個版本進行隱藏,這樣你不知道登入的網站到底用的是什麼服務器

JFWS/3.0 虛構web服務 虛構版本號

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

[root@localhost src]# ls

core  event  http  mail  misc  os  stream

[root@localhost core]# cd core

[root@localhost core]# vi nginx.h

這裏面定義了版本的信息

#define NGINX_VERSION      "3.0"

#define NGINX_VER          "JFWS/" NGINX_VERSION

 

[root@localhost nginx-1.16.1]# ./configure --prefix=/usr/local/nginx  --預編譯

[root@localhost nginx-1.16.1]# make build && make install  --編譯並且安裝

[root@localhost nginx-1.16.1]# /usr/local/nginx/sbin/nginx  --啓動nginx,再去訪問就ok了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章