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_flagsdirective.
- 
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. 
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>
After uninstalling the package, you will need to disable the module in the NGINX configuration file.
- 
In a text editor, open the NGINX Plus configuration file: - /etc/nginx/nginx.conffor Linux
- /usr/local/etc/nginx/nginx.conffor FreeBSD
 
- 
Disable dynamic loading of the module by removing the corresponding load_moduledirective.
- 
Remove all directives related to the dynamic module. 
- 
Save the configuration. 
- 
Test the NGINX Plus configuration. In a terminal, type-in the command: nginx -tExpected output of the command: shell nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf is successful
- 
Reload the NGINX Plus configuration: nginx -s reload