一、默認使用curl命令訪問:nginx
# curl -I http://172.17.0.5vim
二、修改nginx.conf配置文件,在http配置段中新增以下代碼:dom
# vim /usr/local/nginx/conf/nginx.confcurl
server_tokens off;ide
三、修改fastcgi.conf配置文件,註釋以下代碼:url
# vim /usr/local/nginx/conf/fastcgi.confspa
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;server
四、重載Nginx:blog
# nginx -s reloadtoken
五、使用curl命令訪問:
# curl -I http://172.17.0.5
六、僞造Nginx的名稱和版本號:
# vim /usr/src/nginx-1.16.1/src/core/nginx.h,修改以下代碼
#define NGINX_VERSION "1.16.1" --> #define NGINX_VERSION "2.3.2"
#define NGINX_VER "nginx/" NGINX_VERSION --> #define NGINX_VER "Tengine/" NGINX_VERSION
# cd /usr/src/nginx-1.16.1
# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_geoip_module --with-stream_ssl_preread_module --with-compat --with-pcre
# make && make install
# cd /usr/local/nginx/conf
# vim nginx.conf,刪除以前新增的代碼:server_tonkens off;
# nginx -s stop
# nginx
七、使用curl命令訪問:
# curl -I http://172.17.0.5