Already loaded NGINX modules

Maxim Dounin mdounin at mdounin.ru
Fri Feb 12 11:42:27 UTC 2016


Hello!

On Thu, Feb 11, 2016 at 02:33:43PM -0800, Piotr Sikora wrote:

> Hey Yichun,
> 
> > Currently when an NGINX module is statically linked against the NGINX
> > binary, the load_module directive bails out the server startup with
> > the error message "module already loaded" (or something like that).
> > Hopefully we can make this a nonfatal error (or provide an option to
> > make it nonfatal) because we can have more portable nginx.conf for
> > distributing NGINX-based applications.
> 
> I disagree, because this would lead to unexpected behavior (since
> statically linked module can be slightly different from the dynamic
> module).
> 
> Which version should be used at runtime in your non-fatal scenario and why?

+1.

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.

This is very similar to duplicate directives in configuration - 
and duplicate directives are rejected by nginx, for the same 
reasons.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list