Compiling NGINX module as dynamic module for use in docker
NGINX offers some very convenient Docker containers, but it is not documented how to extend the functionality of those containers without re-compiling NGINX yourself and continuously adapting your Dockerfile to match the ones in https://github.com/nginxinc/docker-nginx/.
This gist offers a way to build a NGINX ‘dynamic module’ against the widely used “nginx:alpine” docker image. Simply copy this Dockerfile & replace the arguments of the “wget” & “tar” & “configure” commands to include the module you want to build, then adjust the COPY command copying the module (.so file). In this example the NCHAN module is used as an example.
If you found this helpful, please leave a comment / reaction here! :love:
Thanks everyone for the feedback! I love it that by simply putting this out there I might have helped you guys
Thanks especially @stengerh for the performance boost by only building modules, @petski for the https tip and
CONFARGSchanges and @rwrz for the various improvements. I'll try to update (& test) the gist soon.