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
相关推荐
cesium vue38 分钟前
nginx 流媒体配置
运维·nginx
木心术11 小时前
GitHub Actions自动化运维实战:从CI/CD到全链路DevOps
运维·自动化·github
糯米导航1 小时前
实践教程|搭建电商 AI 无限画布,实现百款商品主图自动化批量生成
运维·人工智能·自动化
朴马丁1 小时前
从制造到智造:PLM如何赋能企业研发创新
大数据·运维·人工智能·食品行业·流程行业plm·化工新材料行业·新能源材料行业
爱小黄1 小时前
使用docker搭建集群-使用 Docker 搭建 KingbaseES 集群
运维·docker·容器
zhougl9962 小时前
Gateway 和 Nginx 路由区别
运维·nginx·gateway
听风3473 小时前
Arch Linux 软件安装完全指南
linux·运维·archlinux·pacman
布兰妮甜3 小时前
跨域全方案对比:CORS、Nginx 反向代理、JSONP、iframe、postMessage
nginx·跨域·cors·前端架构·浏览器安全
沉迷学习 日益消瘦4 小时前
10-Gateway API
运维·kubernetes·gateway
智购科技智能售货柜4 小时前
无人售货机连不上服务器?MQTT 频繁掉线排查全流程~YH
运维·服务器