Czi*_*pO2 4 module nginx nginx-config
运行 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
所以我需要安装替换过滤器模块,并在 nginx 文档https://www.nginx.com/resources/wiki/modules/substitutions/#subs-filter-types 中 说要运行这些命令:
git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
./configure --add-module=/path/to/module
问题是我的 nginx 安装和 git 存储库中的任何地方都没有配置脚本。我真的不明白。至少我想知道那个 nginx 配置脚本的内容。
Dan*_*nin 10
您所指的说明用于编译安装。
假设您想将该模块添加到现有的NGINX 安装中,以下是使事情运行的通用步骤。
/usr/local/src/nginxgit clone NGINX 模块的源代码到您的系统上,例如 /usr/local/src/nginx-module-foocd /usr/local/src/nginx. 您将在此处找到configure脚本。您将基本上使用相关config特定模块的位置配置 NGINX ,因此下一步:./configure --add-dynamic-module=../nginx-module-foo --with-compatmake作为编译的resulf,您将.so在objsNGINX 源目录中的某处拥有模块文件。然后您将其复制到例如/usr/lib64/nginx/modules/目录。
要使现有的 NGINX 加载模块,请load_module modules/foo.so;在/etc/nginx/nginx.conf.
您可以解读整个编译方法的许多缺点:一个是gcc在生产系统上安装了编译软件 ( ),另一个是在升级 NGINX 或模块时必须重新执行所有这些步骤。
出于上述原因,您可能想要搜索第三方模块的打包安装。
对于 CentOS/RHEL 系统,您可能想查看 GetPageSpeed 存储库(订阅软件,我倾向于提及它,因为我是维护者。但在撰写本文时,这对 CentOS/RHEL 8 是免费的. 安装你想要的模块,归结为几个命令:
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install nginx-module-substitutions
对于基于 Debian 的系统,可能存在替代的 PPA。
| 归档时间: | 
 | 
| 查看次数: | 4743 次 | 
| 最近记录: |