Skip to content
VirtuBox edited this page Aug 22, 2019 · 3 revisions

Update in progress

This page will be updated as soon as possible with more informations, and better examples to explain how to customize nginx compilation with nginx-ee


You can choose Nginx built-in and third-party modules you want to compile with Nginx-ee. To do so, you can override the list of modules compiled by Nginx-ee by exporting the variable OVERRIDE_NGINX_MODULES before launching the script.

Some Nginx modules are built by default and do not have to be specified (for example --with-http_gzip_module isn't required). Default modules can be explicitly excluded with the flag --without-ngx_module_name But many modules are not built by default and must be listed in the modules to compile, for example you can add mp4 streaming module with --with-http_mp4_module. You do not need to use --without for modules not built by default with Nginx.

The list of Nginx modules compiled by default and optional modules is available on Nginx Docs

To override official modules compiled with nginx-ee, export the variable OVERRIDE_NGINX_MODULES before launching nginx-ee script.

To override third-party modules compiled with nginx-ee, export the variable OVERRIDE_NGINX_ADDITIONAL_MODULES before laucnhing nginx-ee script. Important : If you want to add a third-party module, you will have to download its source in /usr/local/src before launching the compilation.

Examples :

Override list of modules built by default with nginx-ee

# choose modules you want to build
# This is the list of modules built by default with nginx-ee
export OVERRIDE_NGINX_MODULES="--without-http_uwsgi_module \
    --without-mail_imap_module \
    --without-mail_pop3_module \
    --without-mail_smtp_module \
    --with-http_stub_status_module \
    --with-http_realip_module \
    --with-http_auth_request_module \
    --with-http_addition_module \
    --with-http_geoip_module \
    --with-http_gzip_static_module \
    --with-http_image_filter_module \
    --with-http_mp4_module \
    --with-http_sub_module"


# compile nginx-ee with the modules previously selected
bash <(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee)

Override list of third-party modules built by default with nginx-ee

You can add/remove additional third-party modules compiled with nginx-ee. By default Nginx-ee will compile the following third-party modules

    --add-module=/usr/local/src/ngx_http_substitutions_filter_module \
    --add-module=/usr/local/src/srcache-nginx-module \
    --add-module=/usr/local/src/ngx_http_redis \
    --add-module=/usr/local/src/redis2-nginx-module \
    --add-module=/usr/local/src/memc-nginx-module \
    --add-module=/usr/local/src/ngx_devel_kit \
    --add-module=/usr/local/src/set-misc-nginx-module \
    --add-module=/usr/local/src/ngx_http_auth_pam_module \
    --add-module=/usr/local/src/nginx-module-vts \
    --add-module=/usr/local/src/ipscrubtmp/ipscrub

Here an example to add the nginx module mod_zip :

# clone the module repository into /usr/local/src
git clone https://github.com/evanmiller/mod_zip.git /usr/local/src/mod_zip

# add the module to the modules list using the variable OVERRIDE_NGINX_ADDITIONAL_MODULES
# This is the list of third-party modules built by default with nginx-ee + mod_zip module
export OVERRIDE_NGINX_ADDITIONAL_MODULES="--add-module=/usr/local/src/ngx_http_substitutions_filter_module \
    --add-module=/usr/local/src/srcache-nginx-module \
    --add-module=/usr/local/src/ngx_http_redis \
    --add-module=/usr/local/src/redis2-nginx-module \
    --add-module=/usr/local/src/memc-nginx-module \
    --add-module=/usr/local/src/ngx_devel_kit \
    --add-module=/usr/local/src/set-misc-nginx-module \
    --add-module=/usr/local/src/ngx_http_auth_pam_module \
    --add-module=/usr/local/src/nginx-module-vts \
    --add-module=/usr/local/src/ipscrubtmp/ipscrub \
    --add-module=/usr/local/src/mod_zip" # add mod_zip module at the end of the list

# compile nginx-ee with the modules previously selected
bash <(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee)