Description
Enabling --with-compat
makes it much easier for end-users to build and use dynamic modules for NGINX in custom images.
The way NGINX dynamic module compilation works is that a user has to download the source code for the matching NGINX version, and then run:
./configure --with-compat --add-dynamic-module=/module/src/path
make modules
This will compile the dynamic modules for the matching NGINX version. However, this approach only works when the main NGINX binary was compiled with --with-compat
. If that is not the case, the ./configure
line must specify the exact same compilation options that the main NGINX binary was compiled with. This makes the build process for dynamic modules much more complicated, especially for OpenResty where external libraries like OpenSSL and PCRE are downloaded outside of the build system.
What happens under the covers is that extra fields are added or extra memory reserved in internal data structures. This does result in a slight increase in memory usage.
See:
https://forum.nginx.org/read.php?29,270210,270213#msg-270213
https://mailman.nginx.org/pipermail/nginx-devel/2018-May/011119.html
The --with-compat
option is enabled in the upstream NGINX packages and Docker image.
It was enabled in Ubuntu with Disco Dingo.
Unfortunately, it does not seem to be enabled in the upstream OpenResty binaries. Maybe an issue should be raised there as well?