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

相关推荐
少妇的美梦19 小时前
logstash教程
运维
chen94520 小时前
k8s集群部署vector日志采集器
运维
chen94520 小时前
aws ec2部署harbor,使用s3存储
运维
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220891 天前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++1 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy1 天前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡
Yyyy4821 天前
Nginx负载均衡集群实验步骤
运维·nginx·负载均衡
獭.獭.1 天前
Linux -- 信号【上】
linux·运维·服务器
hashiqimiya1 天前
centos配置环境变量jdk
linux·运维·centos