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

相关推荐
知白守黑26742 分钟前
Ansible角色
运维·服务器·ansible
Jwest202142 分钟前
工业显示器在地铁电力监控与运维中的应用
运维·计算机外设
fuyongliang1235 小时前
nginx反向代理,负载均衡,tomcat的数据流向图篇解析
nginx·tomcat·负载均衡
tuokuac6 小时前
nginx配置前端请求转发到指定的后端ip
前端·tcp/ip·nginx
Mr. Cao code7 小时前
Docker:颠覆传统虚拟化的轻量级革命
linux·运维·ubuntu·docker·容器
LUCIAZZZ8 小时前
HTTPS优化简单总结
网络·网络协议·计算机网络·http·https·操作系统
wanhengidc8 小时前
云手机运行流畅,秒开不卡顿
运维·网络·科技·游戏·智能手机
笨小孩@GF 知行合一9 小时前
OSPF实验:外部路由引入
运维·网络·hcip·数通·ospf
asdfg12589639 小时前
为什么要在出口路由器router配置NAT与默认路由
运维·网络·计算机网络
青草地溪水旁9 小时前
http response的工作流程详细解析
网络协议·http·应答