Nginx is a web server and reverse proxy server that can be extended with modules. Here’s how you can list the installed Nginx modules and the compiled flags on Ubuntu and Debian Linux:
- To list the installed Nginx modules, use the command “nginx -V” or “nginx -V 2>&1”
- The command will display the version of Nginx and a list of modules compiled into the binary. The list of modules is displayed after the string “configure arguments:”, each module will be preceded by the “–with-” or “–add-module=” prefix.
- To list the compiled flags, you can use the command “nginx -V 2>&1 | grep -o –.*”
- The command will display the compiled flags, each flag will be preceded by the “–” prefix.
- You can also use the command “nginx -V 2>&1 | grep -o -D.*” or “nginx -T” to list the configuration options passed to the Nginx binary at compile-time.
It’s important to note that, if you have multiple Nginx versions installed on your system, you will need to specify the path to the Nginx binary you want to check.
Additionally, if you want to check the status of loaded modules, you can use the command “nginx -T” this command will display the configuration file, the loaded modules and the directives they provide.