Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What I want to do is guard against configuration segments with invalid directives being run in an nginx that doesn't have the proper module installed. Something like the IfModule directive in Apache (http://httpd.apache.org/docs/current/mod/core.html#ifmodule). Does anything similar exist in nginx?

share|improve this question
1  
Why not just do nginx -t to check the syntax before restarting nginx? –  ceejayoz Jun 4 '13 at 19:17
2  
To clarify, this is in order to ship config files which, if loaded in the absence of certain modules, won't make an end-user's nginx barf. To take the onus off of them to double-check settings when loading a provided config file. If certain module is missing, then no-op. –  dkuebric Feb 5 at 15:19
add comment

1 Answer

up vote 1 down vote accepted

Apache's <IfModule> applies a set of directives if the specific module is loaded.

Since Nginx does not support dynamic module loading, this feature is not available.

Source: http://trac.nginx.org/nginx/ticket/126

share|improve this answer
1  
this was my fear –  dkuebric Feb 5 at 15:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.