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

相关推荐
君穆南14 分钟前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
bloglin9999917 分钟前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索27 分钟前
LINUX环境
linux·运维·服务器
yuanjj8829 分钟前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
IMPYLH1 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara1 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
Cx330❀2 小时前
Linux命名管道(FIFO)通信:从原理到实操,一文搞懂跨进程通信
大数据·linux·运维·服务器·elasticsearch·搜索引擎
嵌入式×边缘AI:打怪升级日志2 小时前
嵌入式Linux应用开发快速入门(从零到第一个程序)
linux·运维·notepad++
LCG元2 小时前
STM32实战:基于STM32F103的4G模块(EC20)HTTP通信
stm32·嵌入式硬件·http
AI、少年郎3 小时前
MiniMind第 2 篇:破除大模型 “神秘感“, 环境搭建|Win/Linux 本地快速部署
linux·运维·服务器·ai·大模型训练·大模型微调·大模型原理