Installing Third-Party Modules#

In addition to our own dynamic modules for Angie and Angie PRO, we collect and publish packages for a number of popular nginx-compatible third-party modules, developed outside our company, in our repository.

Installation and Configuration#

Third-party module packages are installed from our repository just like our own packages:

To use the installed module in configuration, load it using the load_module directive in the main context:

load_module modules/<module_name>.so;

Tip

Package names and the modules themselves in the configuration have the following prefixes:

  • Angie: angie-module-<name>

  • Angie PRO: angie-pro-module-<name>

Note

We do not review the source code of these modules and are not responsible for the consequences of their installation; the packages are compiled based on numerous requests exclusively for user convenience.

List of Packages#

Module

Version

Packages

Auth JWT

0.15.0

angie-module-auth-jwt
angie-pro-module-auth-jwt

Auth LDAP

241200e

angie-module-auth-ldap
angie-pro-module-auth-ldap

Auth PAM

v1.5.5

angie-module-auth-pam
angie-pro-module-auth-pam

Auth SPNEGO

v1.1.3

angie-module-auth-spnego
angie-pro-module-auth-spnego

Auth TOTP

1.2.0

angie-module-auth-totp
angie-pro-module-auth-totp

Brotli

v1.0.0rc

angie-module-brotli
angie-pro-module-brotli

Cache Purge

3.0.4

angie-module-cache-purge
angie-pro-module-cache-purge

CGI

v0.15.2

angie-module-cgi
angie-pro-module-cgi

Combined Upstreams

2.3.1

angie-module-combined-upstreams
angie-pro-module-combined-upstreams

DAV Ext

v4.0.1

angie-module-dav-ext
angie-pro-module-dav-ext

Dynamic Limit Req

1.9.3

angie-module-dynamic-limit-req
angie-pro-module-dynamic-limit-req

Echo

v0.65

angie-module-echo
angie-pro-module-echo

Enhanced Memcached

v0.3

angie-module-enhanced-memcached
angie-pro-module-enhanced-memcached

Eval

2016.06.10

angie-module-eval
angie-pro-module-eval

GeoIP2

3.4

angie-module-geoip2
angie-pro-module-geoip2

Headers More

v0.40

angie-module-headers-more
angie-pro-module-headers-more

HTTP Auth RADIUS

458af16

angie-module-http-auth-radius
angie-pro-module-http-auth-radius

JWT

v3.4.6

angie-module-jwt
angie-pro-module-jwt

Keyval

0.5.0

angie-module-keyval
angie-pro-module-keyval

Lua: http_lua_module, stream_lua_module

0.10.31 / v0.0.17

angie-module-lua
angie-pro-module-lua

ModSecurity

v1.0.4

angie-module-modsecurity
angie-pro-module-modsecurity

NJS: http_js, stream_js

1.0.2

angie-module-njs
angie-pro-module-njs

NDK

v0.3.4

angie-module-ndk
angie-pro-module-ndk

OIDC

0.8.0

angie-module-oidc
angie-pro-module-oidc

OpenTracing

v0.50.0

angie-module-opentracing
angie-pro-module-opentracing

OpenTelemetry

v0.1.2

angie-module-otel
angie-pro-module-otel

PostgreSQL

1.0rc7

angie-module-postgres
angie-pro-module-postgres

Redis2

v0.15

angie-module-redis2
angie-pro-module-redis2

RTMP

v1.2.2

angie-module-rtmp
angie-pro-module-rtmp

Set Misc

v0.34

angie-module-set-misc
angie-pro-module-set-misc

Subs

e12e965

angie-module-subs
angie-pro-module-subs

TestCookie

7d263d4

angie-module-testcookie
angie-pro-module-testcookie

UnBrotli

60bed63

angie-module-unbrotli
angie-pro-module-unbrotli

UnZstd

658990e

angie-module-unzstd
angie-pro-module-unzstd

Upload

2.3.0

angie-module-upload
angie-pro-module-upload

VOD

v1.10.1

angie-module-vod
angie-pro-module-vod

VTS: module-vts, module-sts, module-stream-sts

v0.2.7 / v0.1.1 / v0.1.1

angie-module-vts
angie-pro-module-vts

Weserv Images

v5.1.0

angie-module-weserv-images
angie-pro-module-weserv-images

ZIP

1.3.0

angie-module-zip
angie-pro-module-zip

Zstd

0.90.9

angie-module-zstd
angie-pro-module-zstd

Building a Module for the Packaged Version of Angie or Angie PRO#

If the module you need is not in the list, you can build it yourself for the Angie or Angie PRO that you installed from our packages. Angie and Angie PRO load a dynamic module only if it was built:

  • for the same product, Angie or Angie PRO;

  • for exactly the same version;

  • with matching build options.

Our packages are built without the --with-compat option, so the packaged Angie and Angie PRO reject a module built with the default ./configure options or with --with-compat. The procedure below builds a module that the packaged Angie or Angie PRO loads. You do not rebuild or replace Angie or Angie PRO itself: the package stays installed, and the module is built separately and loaded into it. The module is built in the Angie source tree of the same version as the installed package, with the build options of that package. Angie PRO ships only as binary packages, without source code, but it uses the same build system as Angie. To build a module for Angie PRO, you use the same Angie source tree with the header files and the build configuration of Angie PRO from the angie-pro-headers package.

The steps use ngx-fancyindex as the example: an arbitrarily chosen module that is not in our list. Other modules take the same steps with their own repository address and module names, plus any libraries or modules that their own build instructions require.

We do not review the code of modules built this way and are not responsible for the consequences of loading them.

  1. Install the compiler, the libraries that Angie is built with, and the tools for getting the source code. On Debian and Ubuntu:

    $ sudo apt install build-essential libpcre2-dev zlib1g-dev libssl-dev libcrypt-dev curl git
    

    On RHEL, Fedora, and derivatives, also install redhat-rpm-config, which provides the compiler settings that our packages are built with:

    $ sudo dnf install gcc make pcre2-devel zlib-devel openssl-devel libxcrypt-devel redhat-rpm-config git
    
  2. Angie PRO only: install angie-pro-headers of the same version as the installed angie-pro package. The angie-pro-headers package installs the header files and the build configuration of Angie PRO into /usr/include/angie-pro/. It comes from the same repository as angie-pro, and its availability depends on your license. It does not depend on angie-pro, so the package manager does not match their versions; specify the version explicitly. On Debian and Ubuntu:

    $ sudo apt install "angie-pro-headers=$(dpkg-query -W -f='${Version}' angie-pro)"
    

    On RHEL, Fedora, and derivatives:

    $ sudo dnf install "angie-pro-headers-$(rpm -q --qf '%{VERSION}-%{RELEASE}' angie-pro)"
    
  3. Download and unpack the Angie source code of the installed version. For Angie PRO, this is the source code of Angie of the same version; the Angie PRO files are added to it in step 6. Angie PRO prints its version with a (PRO) suffix, which the first command drops:

    $ VERSION=$(sudo angie -v 2>&1 | sed -n 's|^Angie version: Angie/\([0-9.]*\).*|\1|p')
    $ echo "$VERSION"
    
        1.12.4
    
    $ curl -fsSO "https://download.en.angie.software/files/angie-$VERSION.tar.gz"
    $ tar -xzf "angie-$VERSION.tar.gz"
    
  4. Clone the module's repository next to the Angie source tree; in the example, it is ngx-fancyindex:

    $ git clone https://github.com/aperezdc/ngx-fancyindex
    
  5. Configure the build with the options of the installed Angie or Angie PRO, adding the module. On RHEL, Fedora, and derivatives, first set the distribution's standard compiler flags, which our packages are also built with but angie -V does not show:

    $ export CFLAGS="$(rpm --eval '%{optflags}')"
    

    Then, on any distribution, run:

    $ cd "angie-$VERSION"
    $ eval ./configure $(sudo angie -V 2>&1 | sed -n 's/^configure arguments: //p' | sed 's/ --with-license//') \
          --add-dynamic-module=../ngx-fancyindex
    

    eval makes the shell honor the quotes in the printed options, so values with spaces stay whole. The second sed removes --with-license, which some Angie PRO packages are built with: Angie's ./configure does not know this option, and the option affects only the Angie PRO executable, not the module. For Angie, the options do not contain it.

    If ./configure fails, fix the cause, for example by installing a missing library, and delete the ../angie-feature-cache directory before running it again: the package options include --feature-cache=../angie-feature-cache, so ./configure saves failed checks there and reports them on the next run as using cached check ... not found.

    On RHEL, Fedora, and derivatives, the errors from a skipped step do not name it: without redhat-rpm-config, ./configure stops with the invalid value in --with-ld-opt="value", and without the exported CFLAGS, with C99 variadic macros support is not found.

  6. Angie PRO only: replace the header files and the build configuration of the source tree with those of Angie PRO:

    $ cp -r /usr/include/angie-pro/. src/
    $ cp src/objs/* objs/
    

    The package mirrors the layout of the src directory, so the first command replaces the header files. The package's objs subdirectory, now at src/objs, holds the build configuration of Angie PRO (ngx_auto_config.h and ngx_auto_headers.h); the second command copies those files into the objs directory that ./configure created. Both commands are needed. The header files give the module the structures and the product signature of Angie PRO. The build configuration sets the build options the module is compiled with: Angie PRO has options that Angie's ./configure does not know, and a module compiled with Angie's configuration would not match the layout of the Angie PRO structures.

  7. Build the module:

    $ make modules
    

    The result is the objs/ngx_http_fancyindex_module.so file.

  8. Install the module:

    $ sudo install -m 644 objs/ngx_http_fancyindex_module.so /etc/angie/modules/
    

Loading and Upgrading#

For Angie and Angie PRO alike, load the module with the load_module directive in the main context, then check and reload the configuration:

load_module modules/ngx_http_fancyindex_module.so;
$ sudo angie -t && sudo systemctl reload angie

If the module does not match the installed Angie or Angie PRO, angie -t fails with a message that names the mismatch:

  • module "file" was built for "Angie" but you are running "Angie PRO", or the same with the products swapped — the module was built for the other product;

  • module "file" version module_version instead of angie_version — the module was built for another version; each version is printed as a single integer, with the minor version and the patch number zero-padded to three digits;

  • module "file" is not binary compatible — the module was built with other build options.

Every new version of Angie or Angie PRO requires rebuilding the module: it rejects a build for the previous version with the version error. If the service is running when the package is upgraded to a new version, the package tries to switch it to the new executable on the fly. With the module built for the previous version, the new executable rejects the configuration, so the switch does not happen: the package prints a Binary upgrade failed message, and the previous executable keeps serving.

After the upgrade, rebuild and reinstall the module, reusing its source code from the first build: repeat steps 3 and 5 to 8, starting in the directory where you ran step 3 for the first build; for Angie PRO, repeat step 2 first. The last step uses install, not cp, because install writes a new file instead of overwriting the one that the running service has loaded. Then restart the service so that the new executable starts with the rebuilt module:

$ sudo angie -t && sudo systemctl restart angie

A reload is not enough here: it succeeds, but the running executable keeps working with the module build it has already loaded. To switch to the new executable and the rebuilt module without interrupting service, use an on-the-fly upgrade instead of a restart.