# problem start nginx with ngx_http_lua_module.so



## andrian (Sep 25, 2019)

Hi, please help me. I use FreeBSD 12.0-RELEASE amd64 and trying run nginx with module ngx_http_lua_module.so. So i have the problem:

```
nginx: [emerg] dlopen() "/usr/local/libexec/nginx/ngx_http_lua_module.so" failed (/usr/local/libexec/nginx/ngx_http_lua_module.so: Undefined symbol "ndk_set_var_value") in /usr/local/etc/nginx/nginx.conf:2
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
```
What is mean "Undefined symbol "ndk_set_var_value"" ???
I only load module "ngx_http_lua_module.so" in nginx.conf !
My nginx.conf:

```
load_module "/usr/local/libexec/nginx/ngx_http_headers_more_filter_module.so";
load_module "/usr/local/libexec/nginx/ngx_http_lua_module.so";

user  www;
worker_processes  1;

# This default error log path is compiled-in to make sure configuration parsing
# errors are logged somewhere, especially during unattended boot when stderr
# isn't normally logged anywhere. This path will be touched on every nginx
# start regardless of error log location configured here. See
# https://trac.nginx.org/nginx/ticket/147 for more info.
#
#error_log  /var/log/nginx/error.log;
#

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    
    ...
```


----------



## SirDice (Sep 25, 2019)

I suspect it depends on one or more other nginx modules. What's in your /usr/local/libexec/nginx/ directory?


----------



## andrian (Sep 25, 2019)

Hi. Please look:

```
root@bft:/usr/ports/www/nginx # ls -la /usr/local/libexec/nginx/
total 936
drwxr-xr-x  2 root  wheel    1024 Sep 25 14:57 .
drwxr-xr-x  7 root  wheel     512 Sep 25 14:31 ..
-r-xr-xr-x  1 root  wheel   23096 Sep 25 14:57 ndk_http_module.so
-r-xr-xr-x  1 root  wheel   31328 Sep 25 14:57 ngx_http_auth_digest_module.so
-r-xr-xr-x  1 root  wheel   18992 Sep 25 14:57 ngx_http_brotli_filter_module.so
-r-xr-xr-x  1 root  wheel   14848 Sep 25 14:57 ngx_http_brotli_static_module.so
-r-xr-xr-x  1 root  wheel   18944 Sep 25 14:57 ngx_http_encrypted_session_module.so
-r-xr-xr-x  1 root  wheel   23256 Sep 25 14:57 ngx_http_eval_module.so
-r-xr-xr-x  1 root  wheel   31288 Sep 25 14:57 ngx_http_headers_more_filter_module.so
-r-xr-xr-x  1 root  wheel   14864 Sep 25 14:57 ngx_http_iconv_module.so
-r-xr-xr-x  1 root  wheel  414800 Sep 25 14:57 ngx_http_lua_module.so
-r-xr-xr-x  1 root  wheel   27280 Sep 25 14:31 ngx_http_modsecurity_module.so
-r-xr-xr-x  1 root  wheel   14760 Sep 25 14:57 ngx_http_ssl_ct_module.so
-r-xr-xr-x  1 root  wheel   72544 Sep 25 14:57 ngx_mail_module.so
-r-xr-xr-x  1 root  wheel   18960 Sep 25 14:57 ngx_ssl_ct_module.so
-r-xr-xr-x  1 root  wheel  162864 Sep 25 14:57 ngx_stream_module.so
```


----------



## SirDice (Sep 25, 2019)

I'm not sure if that's the only one you need but add this _before_ ngx_http_lua_module.so:

```
load_module "/usr/local/libexec/nginx/ndk_http_module.so";
```


----------



## andrian (Sep 25, 2019)

Thanks. fix.


----------

