+-
安装后Nginx模块http_stub_status_module加载问题
我在我的一台服务器上使用nginx,我下载它的源代码并使用以下代码编译它:

./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module \
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log  \
--add-module=/opt/ngx_http_substitutions_filter_module \
--with-http_stub_status_module

在conf.d中设置和添加文件,它的工作正常.但突然当我重新启动它给我错误消息:

nginx: [emerg] unknown directive "stub_status" in /etc/nginx/conf.d/mytest.conf:6

我查看了更多细节,发现它无法加载模块“http_stub_status_module”.我知道我用安装编译它.

My Question is there any way i can reload this module or add somewhere in conf to make it working??**i dont want to install it again because if i compiled it again it will remove my current configuration.

最佳答案
与其他软件(如Apache)不同,Nginx没有在运行时加载模块的机制;他们必须编译.

如果在构建新版本之前在旧版本上运行nginx -V,您将收到一条消息,其中包含使用它构建的configure命令.尝试在新的源代码树中使用相同的树;如果你实际上没有你需要的模块,那么它将失败.如果使用相同命令的配置和后续构建都成功,那么您应该有理由相信您的新构建具有与旧构建相同的功能.当然,您仍需要注意可能对nginx本身或任何这些模块进行的任何重大更改.

点击查看更多相关文章

转载注明原文:安装后Nginx模块http_stub_status_module加载问题 - 乐贴网