首页 > 其他 > 详细

nginx安全

时间:2015-11-30 18:17:30      阅读:308      评论:0      收藏:0      [点我收藏+]

1.隐藏版本号和server信息

[root@node1 nginx-1.8.0]# vim src/core/nginx.h 

#define NGINX_VERSION       ""

#define NGINX_VER          "tingyun/" NGINX_VERSION

#define NGINX_VAR          "tingyun"

[root@node1 nginx-1.8.0]# vim src/http/ngx_http_header_filter_module.c 

static char ngx_http_server_string[] = "" CRLF;

static char ngx_http_server_full_string[] = "" NGINX_VER CRLF;

[root@node1 nginx-1.8.0]# vim src/http/ngx_http_special_response.c 

"<hr><center>tingyun</center>" CRLF

[root@node1 nginx-1.8.0]# ./configure  --prefix=/usr/local/nginx-1.8.0  --with-file-aio  --with-poll_module  --with-pcre  --without-http_autoindex_module  --without-http_ssi_module  --without-mail_pop3_module  --without-mail_smtp_module  --without-mail_imap_module

[root@node1 nginx-1.8.0]# make && make install


2.下载安装modsecurity安全模块

[root@node1 ~]# yum install libtool httpd-devel libevent libevent-devel library-devel -y

[root@node1 ~]# tar xvf ModSecurity-2.9.0.tar.gz 

[root@node1 ModSecurity-2.9.0]# ./configure --enable-standalone-module --disable-mlogc

[root@node1 ModSecurity-2.9.0]# make

[root@node1 nginx-1.8.0]# ./configure  --prefix=/usr/local/nginx-1.8.0  --with-file-aio  --with-poll_module  --with-pcre  --without-http_autoindex_module  --without-http_ssi_module  --without-mail_pop3_module  --without-mail_smtp_module  --without-mail_imap_module --add-module=/root/ModSecurity-2.9.0/nginx/modsecurity/

[root@node1 nginx-1.8.0]# make && make install


本文出自 “一起走过的日子” 博客,请务必保留此出处http://tongcheng.blog.51cto.com/6214144/1718132

nginx安全

原文:http://tongcheng.blog.51cto.com/6214144/1718132

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!