安装nginx-1.25.5与ngx_http_headers_more_filter_module模块

XML 复制代码
#下载nginx的代码
curl -O http://nginx.org/download/nginx-1.25.5.tar.gz
#下载headers-more-nginx-module代码
git clone https://github.com/openresty/headers-more-nginx-module

#解压
tar -xzf nginx-1.25.5.tar.gz

cd nginx-1.25.5

#--add-dynamic-module 下载下来的目录 --prefix nginx安装的目录
./configure --add-dynamic-module=/data/nginx/headers-more-nginx-module/ --prefix=/data/nginx  --with-http_stub_status_module --with-http_ssl_module

#安装
make && make install

安装完成之后 先启动看看nginx 是否正常 ,然后找个浏览器看看 是否正常

然后修改配置nginx.conf 主要是引用 和 http 下面的配置

XML 复制代码
 load_module modules/ngx_http_headers_more_filter_module.so;
 
 events {
     worker_connections  1024;
 }
 
 
 http {
     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';
 
     access_log  /var/log/nginx/access.log  main;
     server_tokens off;
     more_clear_headers 'Server';
     include       mime.types;
     default_type  application/octet-stream;

然后重启nginx 再用浏览器看看

相关推荐
释怀不想释怀5 小时前
Linux文件上传(rz)和下载(sz)压缩(tar.gz)和解压(zip)
linux·运维·服务器
IOsetting5 小时前
金山云主机添加开机路由
运维·服务器·开发语言·网络·php
酉鬼女又兒6 小时前
零基础入门Linux指南:每天一个Linux命令_sed
linux·运维·服务器
-dcr6 小时前
58.DevOps进阶
运维·devops
猫头虎6 小时前
如何使用Docker部署OpenClaw汉化中文版?
运维·人工智能·docker·容器·langchain·开源·aigc
XiaoMu_0016 小时前
自动化漏洞扫描与预警平台
运维·网络·自动化
醉风塘6 小时前
Linux进程管理:深度解析ps -ef命令及其高级应用
linux·运维·服务器
会周易的程序员6 小时前
openplc runtimev4 Docker 部署
运维·c++·物联网·docker·容器·软件工程·iot
BLSxiaopanlaile6 小时前
《凤凰架构-构建可靠的大型分布式系统》读书笔记 -关于网络通信安全性的一些总结
http·加密·认证授权·网络通信安全
陈桴浮海6 小时前
【Linux&Ansible】学习笔记合集三
linux·运维·云原生·ansible