Nginx 隐藏版本信息和logo

1.隐藏版本信息

复制代码
http {
   ### 隐藏版本号    
   server_tokens off;
}

2.隐藏图标

2.1 cd nginx 安装的路径

cd/XXXX/nginx-1.2.0

2.2 编辑文件

vim src/core/nginx.h 修改define nginx_ver 中的内容

vim src/http/ngx_http_special_response.c 修改 u_char ngx_http_error_tail\[\] 下面的内容

vim src/http/ngx_http_header_filter_module.c 修改u_char ngx_http_server_string\[\]中内容

4.查看之前版本安装的信息

/opt/nginx/sbin/nginx -V

5.重新编译和make

复制代码
./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-stream --with-http_gzip_static_module --with-openssl=/usr/local/openssl --add-module=/usr/local/fastdfs-nginx-module/src

6.备份和升级

备份之前的nginx

复制代码
mv /opt/nginx/sbin/nginx /opt/nginx/sbin/nginx.old
### 复制新的nginx
cp /opt/nginx-1.2/objs/nginx /opt/nginx/sbin/nginx
### 在/opt/nginx-1.2目录下
make upgrade
相关推荐
fiveym3 小时前
01 - iPXE + Clonezilla 网络装机原理解析
linux·运维·服务器·网络
虎头金猫3 小时前
如何在群晖NAS上通过Docker部署CloudSaver?群晖部署CloudSaver教程|聚合资源搜索并实现远程访问
运维·服务器·网络·python·docker·容器·pandas
反转180度4 小时前
Qt 6 + C++17 实现 SFTP 批量部署:工业设备运维工具实战解析
运维·c++·qt
雨辰AI4 小时前
RAG 知识库搭建:基于人大金仓构建信创运维问答机器人|全栈国产化落地完整版
运维·ai·机器人·ai编程
-今昭-5 小时前
Ansible
linux·运维·ansible
星野川崎2065 小时前
电商多店运维:云机长期挂机频繁掉线、账号无故风控原因剖析与解决方案
大数据·运维·云计算·电商
g10565591395 小时前
LAMP博客平台Wordpress实战
android·mysql·nginx·php
IT邦德7 小时前
Dify1.6基于ubuntu系统的部署实战
linux·运维·ubuntu
蓝速科技8 小时前
蓝速科技会议电子门牌规模化部署与运维成本实测
运维·科技
许彰午8 小时前
# allbytaskid——一个接口扛六个DataStore
运维·服务器·php