nginx安全
2015-11-30 12:42
525 查看
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
[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 js、css多个请求合并为一个请求(concat模块)
- nginx.conf配置文件的基本详解
- Nginx重写规则指南 转
- nginx做rails项目web服务器缓存配置方法
- Ubuntu下安装Nginx
- nginx服务配置---php服务接入
- Nginx和lvs在负载均衡方面的对比
- nginx php-fpm 输出php错误日志
- Nginx代码风格图示
- Centos安装nginx
- nginx---别名(alias)在ci框架的应用
- Debian 7/Ubuntu14.04 LNMP环境搭建
- wordpress 图片裁剪问题处理
- nginx+ngrok的配置
- Nginx配置文件nginx.conf中文详解(汇总)
- nginx的安装及配置
- nginx做mail proxy 的时候,把消息proxy到哪里去了 4000
- nginx 基本配置
- 开启reuse_port让Tengine性能提升3倍
- LVS Nginx HAProxy 优缺点