NGINX——如何修改缺省banner

简介: NGINX——如何修改缺省banner

前言

漏洞啊,漏洞啊,要先停止nginx服务

步骤

解压安装包

使用的是一件部署包,所以要单独拿出来搞下~

tar -zxvf nginx-1.16.1.tar.gz

修改文件ngx_http_header_filter_module.c

cd nginx-1.16.1/src/http/
vi ngx_http_header_filter_module.c 
# 要修改的配置
static u_char ngx_http_server_string[] = "Server: nginx" CRLF;
static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;

原文件:

修改为:

static u_char ngx_http_server_string[] = "Server: unknow" CRLF;
static u_char ngx_http_server_full_string[] = "Server: unknow"  CRLF;
static u_char ngx_http_server_build_string[] = "Server: unknow"  CRLF;

重新编译

cd nginx-1.16.1
# 安装nginx的目录 --prefix=/usr/local/nginx 
 ./configure --prefix=/usr/local/nginx && make && make install

编译报错信息

#提示需要PCRE库
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

解决方法

yum -y install pcre-devel

再次编译

#编译
./configure --prefix=/usr/local/nginx && make && make install 
#安装依赖
./configure --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=./openssl-1.0.2t --with-pcre=./pcre-8.43 --with-pcre-jit --with-ld-opt='-ljemalloc'  && make && make install

验证


学无止境,谦卑而行.

目录
相关文章
|
开发工具
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(三)
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(三)
365 0
|
JSON 前端开发 JavaScript
富文本编辑器Ueditor实战(三)-springboot集成
通过本文,您可了解springboot如何集成ueditor,如何自定义扩展后端的文件上传功能。
1147 0
富文本编辑器Ueditor实战(三)-springboot集成
|
NoSQL Linux Redis
|
2月前
|
人工智能 自然语言处理 安全
2026年OpenClaw(Clawdbot)阿里云官方部署教程+Slack快速接入指南
OpenClaw(原Clawdbot)作为企业级AI自动化代理工具,凭借跨平台协作、轻量化部署、插件化扩展的核心优势,成为全球化团队、远程办公场景下Slack协作提效的关键工具。2026年阿里云推出OpenClaw专属云端部署方案,结合Slack在海外企业协作场景的高渗透率,实现“Slack频道/私信下达指令,阿里云服务器运行的OpenClaw执行自动化任务”的高效模式。本文将完整拆解阿里云云端部署OpenClaw的全流程,重点详解Slack App创建、权限配置、跨境网络适配、机器人对接调试的核心步骤,包含实操代码命令与海外协作场景避坑技巧,零基础用户也能快速完成从部署到落地的全流程。
895 0
|
JavaScript 搜索推荐 资源调度
使用VitePress静态网站生成器创建组件库文档网站并部署到GitHub
本文详细介绍了如何使用 Vue3、TypeScript 和 Vite 开发并发布一个名为 Vue Amazing UI 的组件库至 npm。文章首先引导读者安装配置 VitePress,创建文档网站,并编写组件库文档。接着,通过一系列配置实现网站主题定制、全局样式设置以及 Algolia 搜索功能集成。最后,文章提供了自动化脚本,帮助开发者一键打包部署静态网站至 GitHub,并发布组件库到 npm。通过这些步骤,读者可以轻松搭建并维护一个美观且功能齐全的组件库文档网站。
377 2
使用VitePress静态网站生成器创建组件库文档网站并部署到GitHub
|
存储 JavaScript 前端开发
Xss跨站脚本攻击(Cross Site Script)
Xss跨站脚本攻击(Cross Site Script)
|
XML Java 应用服务中间件
Tomcat项目创建 以及 在IDEA当中集成Tomcat
Tomcat项目创建 以及 在IDEA当中集成Tomcat
|
运维 网络协议 Python
使用tcpdump和wireshark进行服务器抓包分析
使用tcpdump和wireshark进行服务器抓包分析
1077 0
|
网络协议 Linux 网络安全
Centos7 防火墙策略rich-rule 限制ip访问-----图文详解
Centos7 防火墙策略rich-rule 限制ip访问-----图文详解
3731 0
|
存储 运维 Kubernetes
在Kubernetes(k8s)中部署 jenkins
由于jenkins需要持久化存储,通过nfs动态供给pvc存储卷。
990 0

热门文章

最新文章