[nginx] Document modules as a way to patch nginx?

Maxim Dounin mdounin at mdounin.ru
Mon Nov 18 16:39:35 UTC 2019


On Thu, Nov 14, 2019 at 04:53:55PM +0100, Guillaume Outters wrote:

> Last night, while trying to progress on my {{.}} syntax in config files 
> by recompiling and recompiling my nginx, I looked at 
> nginx_upstream_check_module source and incidentally discovered that 
> nginx modules where both powerful and easy to create.
> So easy and powerful that the [PATCH] I submitted in september and 
> october could be quickly set into a module, integrating nicely in nginx 
> build.
> So I wondered: couldn't this way of playing with nginx internals be 
> advertized as a notice in 
> http://nginx.org/en/docs/contributing_changes.html?
> Something like:
> ----------------
> Many changes to nginx core source, including those requiring to patch 
> nginx, can be implemented as modules, which are easy to create, easy to 
> publish, and easy to integrate to nginx.
> Before trying to contribute to nginx source, please contemplate 
> packaging your changes as a module. Thus:
> - you will be able to test it in a clean way with your installation, 
> before submitting it to the core
> - your specific needs can be implemented there without conflicting with 
> the community's ones
> - you will be able to distribute it long before it is integrated to 
> nginx
> - you will be able to run it on the very release of nginx your 
> production uses
> ----------------

It currently says "make it clear why the suggested change is 
needed", and this implies the question "wouldn't it better to be a 
module".  Making something a module might be or might not be 
beneficial, depending on various factors.

Note well that many things can be implemented as modules only by 
introducing various hacks, such as re-implementing nginx internal 
functions.  While this approach may appear to work, such a module 
will experience various unexpected problems on changes in nginx 
internals, and hence this is not recommended.

Maxim Dounin

More information about the nginx-devel mailing list