unknown directive "ngx_link_func_lib"
Closed this issue · 5 comments
The following error occurs starting the FreeBSD port of nginx 1.18.0_15,2:
# service nginx onestart
Performing sanity check on nginx configuration:
nginx: [emerg] unknown directive "ngx_link_func_lib" in /usr/local/etc/nginx/nginx.conf:42
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
Starting nginx.
nginx: [emerg] unknown directive "ngx_link_func_lib" in /usr/local/etc/nginx/nginx.conf:42
/usr/local/etc/rc.d/nginx: WARNING: failed to start nginx
nginx has been compiled with the LINK
option enabled to include the nginx-link-function
module:
# pkg info www/nginx
nginx-1.18.0_15,2
Name : nginx
Version : 1.18.0_15,2
Installed on : Wed Jun 17 14:40:05 2020 CEST
Origin : www/nginx
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : www
Licenses : BSD2CLAUSE
Maintainer : joneum@FreeBSD.org
WWW : https://nginx.org/
Comment : Robust and small WWW server
Options :
[...]
LINK : on
[...]
The build log shows that the nginx-link-function
module is indeed enabled.
To reproduce the error on FreeBSD, install nginx from ports and enable LINK
:
# cd /usr/local/ports/www/nginx/
# make config
# make
# make install
is it only happened on nginx 1.18.0_15,2?
I can't replicate your issue , i am using 1.18.0.
Could you try
nginx -V
and see whether nginx-link-function is inside the param?
# nginx -V
nginx version: nginx/1.18.0
built with OpenSSL 1.1.1d-freebsd 10 Sep 2019
TLS SNI support enabled
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I
/usr/local/include' --with-ld-opt='-L /usr/local/lib'
--conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx
--pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log
--user=www --group=www --modules-path=/usr/local/libexec/nginx --with-file-aio
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp
--http-log-path=/var/log/nginx/access.log --with-http_v2_module
--with-http_addition_module --with-http_auth_request_module
--with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module
--with-http_random_index_module --with-http_realip_module --with-pcre
--with-http_secure_link_module --with-http_slice_module --with-http_ssl_module
--with-http_stub_status_module --with-http_sub_module --without-mail_imap_module
--without-mail_pop3_module --without-mail_smtp_module --with-stream_ssl_module
--with-stream_ssl_preread_module --with-threads --with-stream=dynamic
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/ngx_devel_kit-0.3.1
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/ngx_brotli-8104036
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/form-input-nginx-module-0.12
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/headers-more-nginx-module-085fbbc
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/nginx-http-auth-digest-cd86418
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/iconv-nginx-module-0.14
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/nginx-link-function-3.2.3
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/lua-nginx-module-0.10.15
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/ngx_postgres-8aa7359
--add-dynamic-module=/tmp/ports/usr/ports/www/nginx/work/set-misc-nginx-module-cda7e5
I patched version 1.18.0_7,2 to run with nginx-link-function, and sent the patch to the port maintainer. I rebuilt 1.18.0_15,2 from ports, and now the described error occurs.
Edit: I tried a fresh jail installation of nginx and the error persists.
you are using --add-dynamic-module, have you loaded your module ?
load_module modules/ngx-link-function.so
I am not sure where is your link module location.
I am curious Why not add static module?
I haven’t thought of the possibility that the FreeBSD port maintainer has changed the module from beeing statically linked to dynamically. Please excuse me for the needless issue.