ngx_http_dyups_module icon indicating copy to clipboard operation
ngx_http_dyups_module copied to clipboard

用lua方式时这句话“require "ngx.dyups"”报错

Open xiongbenben opened this issue 6 years ago • 3 comments

1、请问用lua方式具体应该怎样用,按照说明写在location的content_by_lua中时会报错找不到ngx.dyups。 2、用lua方式去更新upstream应该是时时写的,在location中不能够时时写,能说一下用lua方式具体怎么用吗

xiongbenben avatar Feb 21 '19 08:02 xiongbenben

To enable dyups LUA API, you MUST put --add-module=./lua-nginx-module in front of --add-module=./ngx_http_dyups_module in the ./configure command.

./configure编译命令的时候,请把lua-nginx-module放在dyups module之前

chobits avatar May 06 '19 11:05 chobits

@chobits 执行如下命令,还是无法获取ngx.dyups.版本2.3.2

./configure
--with-luajit-lib=/usr/local/lib/
--with-luajit-inc=/usr/local/include/luajit-2.0/
--with-lua-inc=/usr/local/include/luajit-2.0/
--with-lua-lib=/usr/local/lib/
--with-ld-opt=-Wl,-rpath,/usr/local/lib
--prefix=/home/nginx2
--add-module=./modules/ngx_http_lua_module
--add-module=../ngx_devel_kit
--add-module=./modules/ngx_http_upstream_dyups_module

piggsoft avatar Mar 19 '20 12:03 piggsoft

这个问题很好解决。

首先看下 ngx_http_upstream_dyups_module/config 文件

请注意这样一段代码: shell if $HTTP_AUX_FILTER_MODULES | grep "ngx_http_lua_module" > /dev/null; then dyups_lua fi

所以,自己下载的lua_nginx_module 要改名成 ngx_http_lua_module,这样才会在 $HTTP_AUX_FILTER_MODULES|grep 'ngx_http_lua_module' 后判断加载了lua模块。只要判断编译参数加载了lua模块,会自动增加lua api支持的。

并且,请无视Tengine官网模块编译说明(页面),新版下面这个注释已经没有意义了,编译参数不存在的。 The module is not compiled into Tengine by default. It can be enabled with '--with-http_dyups_module' configuration parameter, and enabled lua support with '--with-http_dyups_lua_api'. But it can not be compiled as a '.so'.

dzhcool avatar Nov 16 '20 03:11 dzhcool