Opened 8 years ago

Closed 8 years ago

#1115 closed defect (invalid)

Skeleton for dynamic module's config file shows invalid example

Reported by: Whissi@… Owned by:
Priority: major Milestone:
Component: documentation Version: 1.11.x
Keywords: Cc:
uname -a: Linux vm-gentoo-x64 4.8.2-gentoo #1 SMP PREEMPT Mon Oct 17 18:21:15 CEST 2016 x86_64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz GenuineIntel GNU/Linux
nginx -V: nginx version: nginx/1.11.5
built with OpenSSL 1.0.2j 26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib64 --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/lib/nginx/tmp/client --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-compat --with-http_v2_module --with-pcre --with-pcre-jit --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_stub_status_module --with-http_sub_module --with-http_xslt_module --with-http_realip_module --add-module=external_module/nginx-upload-progress-module-0.9.2 --add-module=external_module/headers-more-nginx-module-0.31 --add-module=external_module/ngx_cache_purge-2.3 --add-module=external_module/ngx_slowfs_cache-1.10 --add-module=external_module/ngx-fancyindex-0.4.1 --add-module=external_module/ngx_devel_kit-0.3.0 --add-module=external_module/lua-nginx-module-0.10.6 --add-module=external_module/ngx_http_auth_pam_module-1.5.1 --add-module=external_module/nginx_upstream_check_module-f3bdb7b85a194e2ad58e3c306c1d021ee76da2f5 --add-module=external_module/ngx_metrics-0.1.1 --add-module=external_module/naxsi-0.55.1/naxsi_src --add-module=external_module/nginx-dav-ext-module-0.0.3 --add-module=external_module/echo-nginx-module-0.60 --add-module=external_module/modsecurity-2.9.1/nginx/modsecurity --add-module=external_module/nginx-push-stream-module-0.5.2 --add-module=external_module/nginx-goodies-nginx-sticky-module-ng-08a395c66e42 --add-module=external_module/memc-nginx-module-0.17 --add-module=external_module/nginx-auth-ldap-49a8b4d28fc4a518563c82e0b52821e5f37db1fc --without-http-cache --with-http_ssl_module --with-stream_geoip_module --with-stream_ssl_preread_module --with-stream --with-stream_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx

Description

Hi,

documentation at https://www.nginx.com/resources/wiki/extending/converting/#converting-a-config-file recommends the following skeleton for module's config files to decide whether the module should be build as dynamic or static module:

if test -n "$ngx_module_link"; then

However the complex example says

When compiling a module $ngx_module_link is set to ADDON for compiling a module as a static module and DYNAMIC when compiling as a Dynamic Module. The static compilation calls auto/module twice, once for the CORE module and once for the HTTP module. Whereas the dynamic compilation happens in a single module.

So if $ngx_module_link really is set to ADDON or DYNAMIC the first example will never allow build a static module.

And it looks like some 3rd party addons have already adopted the change resulting in problems, see https://github.com/masterzen/nginx-upload-progress-module/issues/50

Change History (1)

comment:1 by Maxim Dounin, 8 years ago

Resolution: invalid
Status: newclosed

First of all, please note that you are reading a wiki, not a documentation. And this Trac is a wrong place to report problems in wiki if you there are any.

As for the test in question, it is to check if the module is built using a new version of nginx, or an old one. It allows to use the old method of adding modules (if $ngx_module_link is not set). When using newer nginx there is no need for the check at all, and ADDON means static compilation of a module, while DYNAMIC means dynamic compilation. Both are handled by the auto/module script.

Note: See TracTickets for help on using tickets.