https://github.com/openresty/lua-nginx-module/issues/1984

试试

Here is a workaround:

add -lpcre in --with-ld-opt when running configure, for example

./configure --with-compat --with-ld-opt='-lpcre' --add-dynamic-module=../ngx_devel_kit-${DEVEL_KIT_VERSION} --add-dynamic-module=../lua-nginx-module-${LUA_MODULE_VERSION}