1.隱藏版本信息
http {### 隱藏版本號 server_tokens off;
}
2.隱藏圖標
? ?2.1 cd nginx 安裝的路徑
? ? ? ? cd/XXXX/nginx-1.2.0
? 2.2 編輯文件
? ? ? ??vim src/core/nginx.h? 修改define nginx_ver 中的內容
? ? ? ?
? ? ? ??vim src/http/ngx_http_special_response.c 修改?u_char ngx_http_error_tail[] 下面的內容
? ? ??
? ? ??vim src/http/ngx_http_header_filter_module.c? 修改u_char ngx_http_server_string[]中內容
4.查看之前版本安裝的信息
? /opt/nginx/sbin/nginx -V
??
5.重新編譯和make
./configure?--prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-stream --with-http_gzip_static_module --with-openssl=/usr/local/openssl --add-module=/usr/local/fastdfs-nginx-module/src
6.備份和升級
? 備份之前的nginx
mv /opt/nginx/sbin/nginx /opt/nginx/sbin/nginx.old
### 復制新的nginx
cp /opt/nginx-1.2/objs/nginx /opt/nginx/sbin/nginx
### 在/opt/nginx-1.2目錄下
make upgrade