Compile additional nginx modules

Hi,

Did anyone manage to compile an additional nginx module (modsecurity) after EE3 install? I cant seem to find the location the source is downloaded to in order to trigger ./configure --add module

Hello, you can take a look on my bash script to compile nginx with additional modules for EasyEngine :

@virtubox I need some help regarding the same concern. I want the Nginx to be compiled without the following modules:

–without-http_uwsgi_module
–without-mail_imap_module
–without-mail_pop3_module
–without-mail_smtp_module
–without-http_mp4_module
–without-http_stub_status_module
–without-http_realip_module
–without-http_geoip_module \

Also, I don’t want IPSCRUB functionality.

I read all the details on the main of Nginx-EE but I couldn’t understand the major part “How to export the variable OVERRIDE_NGINX_ADDITIONAL_MODULES”?

Do I need to run any command or edit any configuration file in /usr/local/src ?

Hello @nschopra,

in this case, you will have to use the following commands :

# export the variable OVERRIDE_NGINX_MODULES (just replace --with by --without)

export OVERRIDE_NGINX_MODULES="--without-http_uwsgi_module \
    --without-mail_imap_module \
    --without-mail_pop3_module \
    --without-mail_smtp_module \
    --with-http_ssl_module \
    --without-http_stub_status_module \
    --without-http_realip_module \
    --with-http_auth_request_module \
    --with-http_addition_module \
    --without-http_geoip_module \
    --with-http_gzip_static_module \
    --with-http_image_filter_module \
    --with-http_v2_module \
    --without-http_mp4_module  \
    --with-http_sub_module \
    --with-file-aio \
    --with-threads"

# export the variable OVERRIDE_NGINX_ADDITIONAL_MODULES (I have just removed the line related to IPSCRUB)

export OVERRIDE_NGINX_ADDITIONAL_MODULES="--add-module=/usr/local/src/echo-nginx-module \
    --add-module=/usr/local/src/headers-more-nginx-module \
    --add-module=/usr/local/src/ngx_cache_purge \
    --add-module=/usr/local/src/ngx_brotli \
    --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"

# Compile the latest mainline 
bash <(wget -qO - https://raw.githubusercontent.com/VirtuBox/nginx-ee/master/nginx-build.sh) --mainline

Feel free to open a pull request on the github repository if you find a better way to explain the process.

Thanks for replying master. Already tried this way but getting the following types of error:

./configure: error: invalid option "--without-http_stub_status_module

I copied the snippet suggested by you and paster it in Putty as it is:

Hello @nschopra, http_stub_status_module isn’t build by default with Nginx, so you do not need to use --without, just remove the line --with-http_stub_status_module

1 Like

@virtubox, do you have any experience with / advice for including the ngx_http_perl_module?

Hello @rgilman,
it probably require to install the package libperl-dev but it’s an official module so you just have to add the line

--with-http_perl_module
1 Like