安装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 再用浏览器看看

相关推荐
DX_水位流量监测32 分钟前
大坝安全监测之渗流渗压位移监测设备技术解析
大数据·运维·服务器·网络·人工智能·安全
电商API&Tina33 分钟前
京东 API 数据采集接口接入与行业分析
运维·服务器·网络·数据库·django·php
Jinuss1 小时前
HTML页面http-equiv=“refresh“自动刷新原理详解
http·html
Mr_Xuhhh1 小时前
博客标题:深入理解Shell:从进程控制到自主实现一个微型Shell
linux·运维·服务器
864记忆2 小时前
Qt创建连接注意事项
数据库·qt·nginx
Yan-英杰3 小时前
BoostKit OmniAdaptor 源码深度解析
网络·人工智能·网络协议·tcp/ip·http
f***24114 小时前
高效自动化管理临时文件的技术方案
运维·自动化
m0_738120724 小时前
应急响应——知攻善防靶场Linux-1详细应急过程
linux·运维·服务器·网络·web安全·ssh
obboda5 小时前
磁盘管理(MBR、LVM)
运维·5g
kylezhao20195 小时前
S7-1200 CPU 与 S7-200 SMART S7通信(S7-1200 作为服务器)
运维·服务器