Nginx – How to check if an nginx module is installed via nginx config

apache-2.2configurationnginx

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?

Best Answer

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