init module callback called twice

Maxim Dounin mdounin at mdounin.ru
Thu Apr 8 15:20:26 UTC 2021


Hello!

On Thu, Apr 08, 2021 at 09:48:41AM -0400, xdrew wrote:

> Thanks Maxim, this makes perfect sense! However the part of the question
> still stands: is there a way from ngx_cycle_t structure or from some global
> structure to figure out in which mode nginx is running - testing the
> configuration or actually starting?

In most casses a properly written module shouldn't care.  If for 
some reason your module should, there is the ngx_test_config 
global variable which makes it possible to check if nginx is 
testing a configuration rather than parsing a new configuration 
when starting or reloading.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list