作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
运行 nginx -t 时出现此错误:
nginx: [emerg] unknown directive "subs_filter_types" in /etc/nginx/sites-enabled/my.site.com.conf:285
nginx: configuration file /etc/nginx/nginx.conf test failed
git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
./configure --add-module=/path/to/module
最佳答案
您所指的说明适用于编译安装。
假设你想将模块添加到现有的 NGINX 安装中,下面是让事情运行的通用步骤。
/usr/local/src/nginx
git clone
NGINX 模块的源代码到您的系统上,例如/usr/local/src/nginx-module-foo
cd /usr/local/src/nginx
.在这里您可以找到 configure
脚本。您将基本上使用 config
的位置配置 NGINX。有问题的特定模块,因此下一步:./configure --add-dynamic-module=../nginx-module-foo --with-compat
make
.so
文件位于
objs
中的某处你的 NGINX 源目录。然后,您将其复制到例如
/usr/lib64/nginx/modules/
目录。
load_module modules/foo.so;
在
/etc/nginx/nginx.conf
的最顶端.
gcc
),另一个是在升级 NGINX 或模块时必须重新执行所有这些步骤。
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install nginx-module-substitutions
对于基于 Debian 的系统,可能存在相同的替代 PPA。
关于nginx - 如何在 nginx 上安装模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59988807/
我是一名优秀的程序员,十分优秀!