Archive 归档

loading ..

loading ..

(〇)检测 - ``` rpm -qa | grep walle-ngx-headers #是否已安装 ``` ```gray rpm -e walle-ngx-headers #卸载 ``` (一)在线安装 - ```blue rpm -Uvh http://ngx.walle.org/down/rpm/openresty/headers/walle-ngx-headers-2.20.1-1.el7.noarch.rpm #在线安装(rpm) ``` 或 ``` yum -y install http://ngx.walle.org/down/rpm/openresty/headers/walle-ngx-headers-2.20.1-1.el7.noarch.rpm #在线安装(yum) ``` (二)验证 - ### 1)是否已经安装 ``` rpm -qa | grep walle-ngx-headers ``` ### 2)查看(已安装)软件信息 ``` rpm -qi walle-ngx-headers ``` ### 3)查看包内文件 ``` rpm -ql walle-ngx-headers ``` (三)安装 nginx - [nginx 安装参考](//qpress-doc.erhe.cn/.nginx安装/201111-01-官网推荐yum安装最新稳定版/)
wget -O /etc/yum.repos.d/nginx.repo http://ngx.walle.org/down/yum/repo/nginx.repo && yum -y install nginx
```gray cd /usr/share/nginx/html #默认web目录 ``` ```cmd vim /etc/nginx/nginx.conf ``` 在 events { 上面加入: ```gray load_module /walle/ngx/openresty/headers/so/ngx_http_headers_more_filter_module-1.18.0.so; ``` 将 1.18.0 替换成您的 nginx 版本号即可! ```cmd vim /etc/nginx/conf.d/default.conf ``` 在 server { 上面加入: ```gray more_set_headers 'Foo: Bar'; ``` Foo: Bar 换成需要的自定头 --- ```gray ps aux | grep nginx ```
nginx -t && nginx
```gray ps aux | grep nginx ``` (四)访问测试 - ```cmd curl -I localhost ``` 或 Web访问:http://10.0.0.1 查看"响应头" 10.0.0.1 替换成站点 ip 或域名 --- 当前编译版本:https://github.com/openresty/headers-more-nginx-module/archive/refs/tags/v0.33.tar.gz