Already loaded NGINX modules

Maxim Dounin mdounin at
Sat Feb 13 01:00:05 UTC 2016


On Fri, Feb 12, 2016 at 08:50:25AM -0800, Yichun Zhang (agentzh) wrote:

> Hello!
> On Fri, Feb 12, 2016 at 3:42 AM, Maxim Dounin wrote:
> > If there is no need to load a module - there should be no
> > load_module directive in the configuration.  Everything else is
> > likely to cause confusion.
> The problem is that when we prepare nginx configurations for others,
> we may have no idea how about how a particular set of modules are
> built on the user side.

As already pointed out, to properly write a configuration in many 
cases you have to know not only a set of modules, but also 
particular module versions.  I don't think that what you are 
trying to do can be solved by introducing some "tolerant loading".  
Instead, you'll introduce confusion for normal users - and you'll 
still have the same problem with "configurations for others".

> > This is very similar to duplicate directives in configuration -
> > and duplicate directives are rejected by nginx, for the same
> > reasons.
> Not really similar because the nginx configuration writer definitely
> knows if he uses duplicate directives in his own nginx.conf but he can
> hardly know how the nginx binary on the user side is built since
> nginx.conf has no such information nor has a way to detect it in
> nginx.conf itself.

The question here is where you draw a line.  If you assum that the 
administrator controls full nginx.conf configuration, but has no 
idea about modules loaded into nginx installed - well, it's may be 
not very similar.  But if you'll assume that the administrator 
uses some pre-defined configuration snippets he cannot change - 
this case becomes exactly the same.

Maxim Dounin

More information about the nginx-devel mailing list