Uninstalling a dynamic module

You may need to uninstall a dynamic module in NGINX Plus in several scenarios:

  • The module is being replaced with a newer or alternative version. For example, the OpenTracing module has been replaced by the OpenTelemetry module. The Cookie-Flag dynamic module has been superseded by natively supported proxy_cookie_flags directive.

  • The module is no longer supported, for example, the NGINX ModSecurity WAF module.

  • The operating system is not supported by the module. See the the Dynamic Modules section of the NGINX Plus Technical Specifications.

  • The module it is no longer required, uninstalling it helps optimize resource usage and reduce maintenance overhead.

  • The module is causing runtime errors or configuration conflicts that affect stability or performance.

  • Security or compliance policies require removal, particularly in regulated environments where only approved or certified modules are allowed.

Instructions

To uninstall a dynamic module, run the appropriate command for your operating system in a terminal, replacing <MODULE-NAME> with the actual package name, for example, nginx-plus-module-cookie-flag.

  • For Amazon Linux 2, CentOS, Oracle Linux, and RHEL:

    sudo yum remove <MODULE-NAME>
  • For Amazon Linux 2023, AlmaLinux, Rocky Linux:

    sudo dnf remove <MODULE-NAME>
  • For Debian and Ubuntu:

    sudo apt remove <MODULE-NAME>
  • For SLES:

    sudo zypper remove <MODULE-NAME>
  • For FreeBSD:

    sudo pkg delete <MODULE-NAME>

Configuration

After uninstalling the package, you will need to disable the module in the NGINX configuration file.

  1. In a text editor, open the NGINX Plus configuration file:

    • /etc/nginx/nginx.conf for Linux
    • /usr/local/etc/nginx/nginx.conf for FreeBSD
  2. Disable dynamic loading of the module by removing the corresponding load_module directive.

  3. Remove all directives related to the dynamic module.

  4. Save the configuration.

  5. Test the NGINX Plus configuration. In a terminal, type-in the command:

    nginx -t

    Expected output of the command:

    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf is successful
  6. Reload the NGINX Plus configuration:

    nginx -s reload

More Info