nginx安全

简介:

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










本文转自 z597011036 51CTO博客,原文链接:http://blog.51cto.com/tongcheng/1718132,如需转载请自行联系原作者
目录
相关文章
|
安全 应用服务中间件 网络安全
|
6月前
|
安全 应用服务中间件 网络安全
Nginx要怎么配置才算安全
Nginx要怎么配置才算安全
79 0
|
6月前
|
Ubuntu 应用服务中间件 Linux
如何在Ubuntu 14.04上使用Nginx和Php-fpm安全地托管多个网站
如何在Ubuntu 14.04上使用Nginx和Php-fpm安全地托管多个网站
51 0
|
安全 应用服务中间件 API
互联网并发与安全系列教程(14) - 基于Nginx实现API网关
互联网并发与安全系列教程(14) - 基于Nginx实现API网关
142 0
|
9月前
|
缓存 安全 应用服务中间件
蓝易云 - Nginx的HTTPS部署与安全性能优化教程
以上就是在Nginx上部署HTTPS并进行安全性能优化的基本步骤。需要注意的是,这些步骤可能会根据您的具体需求和环境有所不同。
69 0
|
9月前
|
运维 负载均衡 应用服务中间件
安全运维-Nginx服务器就该这么玩~
安全运维-Nginx服务器就该这么玩~
92 0
|
安全 应用服务中间件 数据安全/隐私保护
【2022】Nginx使用acces模块和basic模块做基本安全策略
【2022】Nginx使用acces模块和basic模块做基本安全策略
116 0
|
存储 缓存 安全
深入浅出学习透析Nginx服务器的基本原理和配置指南「Https安全控制篇」
深入浅出学习透析Nginx服务器的基本原理和配置指南「Https安全控制篇」
319 0
深入浅出学习透析Nginx服务器的基本原理和配置指南「Https安全控制篇」
|
运维 安全 搜索推荐