Accept cookies for analytics, social media, and advertising, or learn more and adjust your preferences. These cookies are on by default for visitors outside the UK and EEA. Privacy Notice.
Note
This document outlines the old config
file prior to NGINX 1.9.11. For new modules that are intended to be dynamic modules you should use the New Config Shell File. A guide to converting a module to the new format can be found here.
Every module needs a config
file which is a Bourne shell file guiding the NGINX build system on how to build a module. A typical basic config
file would look like the following:
ngx_addon_name=ngx_http_my_module
HTTP_MODULES="$HTTP_MODULES ngx_http_my_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_my_module.c"
Note
With all these options $ngx_addon_dir
can be used as a placeholder for the source directory for the module.
nxg_addon_name
¶The name of the module. This is used for the console output of the configure
script.
HTTP_MODULES
¶This adds your module to the list of HTTP modules to be loaded. It should be prepended with $HTTP_MODULES
so that it is addative to the list of HTTP modules already defined. The name used in this should be the same name as the module definition struct
HTTP_FILTER_MODULES
¶Similar to HTTP_MODULES
this adds your module to the list of HTTP filter modules to be loaded. It should be prepended with $HTTP_FILTER_MODULES
so that it is additive to the list of HTTP filter modules already defined. The name used in this should be the same name as the module definition struct
MAIL_MODULES
¶Similar to HTTP_MODULES
this adds your module to the list of mail modules to be loaded. It should be prepended with $MAIL_MODULES
so that it is additive to the list of mail modules already defined. The name used in this should be the same name as the module definition struct
STREAM_MODULES
¶Similar to HTTP_MODULES
this adds your module to the list of TCP/IP stream modules to be loaded. It should be prepended with $STREAM_MODULES
so that it is additive to the list of TCP/IP stream modules already defined. The name used in this should be the same name as the module definition struct
NGX_ADDON_SRCS
¶A list of source files to be used to build the module. This should be prepended with $NGX_ADDON_SRCS
so that previous module sources are also included.
HTTP_INCS
¶A list of include directories to be used to build the module. This should be prepended with $HTTP_INCS
so that the include directories for other modules are included.
HTTP_DEPS
¶A list of include files the build depends on. This should be prepended with $HTTP_DEPS
so that include files from other modules are included.