I am wondering if there is anything in the pipeline that may ease config validation testing. The use-case I am currently working on is testing the validity of config for a certain module. If for a particular location a module is active, than a certain other directives should be present, and if they are present it should be possible to test for some other predicates at runtime (for example files on the file-system, where filenames are specified as directives for the module).
Nginx's out-of-the-box configuration is quite elegant, and it is hard to write incorrect config files. And most common settings have default values. However in my case I require more validation.
I have hacked together some code to test weather all requisite directives have been set (in contrast to checking them one by one, and returning a single error at a time). If one or more aren't, the code builds and returns a formatted list of missing directives.
I'm just wondering if there is room for modelling such dependencies directly in the "ngx_comman_t array" provided when creating a module, and perhaps for a general purpose delegate mechanism that would allow other predicates to be evaluated at runtime.