Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | N/A |
How to find out Nginx version
You can pass the -v or -V option to display nginx web server version. The syntax is:
nginx -v
Sample outputs:
nginx version: nginx/1.2.3
Check Nginx version command
The -V option shows nginx version, compiler version and configure parameters.
nginx -V
Sample outputs:
nginx version: nginx/1.2.3 built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) TLS SNI support enabled configure arguments: --without-http_autoindex_module --without-http_userid_module --without-http_auth_basic_module --without-http_fastcgi_module --without-http_empty_gif_module --with-poll_module --with-http_stub_status_module --with-http_ssl_module --with-ipv6 --with-http_geoip_module
Here is output from the Ubuntu Linux 16.04 LTS server:
See if Nginx is compiled with a particular module or not
Use the nginx command as follows along with the grep command. Open shell prompt and then type:
nginx -V 2>&1 | grep --color 'module-name'
nginx -V 2>&1 | grep --color -o 'module-name'
# find if geoip2_module compiled or not #
nginx -V 2>&1 | grep --color 'geoip2_module'
# find if realip_module compiled or not #
nginx -V 2>&1 | grep --color 'http_realip_module'
# Check for gunzip_module compiled or not #
nginx -V 2>&1 | grep --color -o 'http_gunzip_module'
Sample outputs:
http_gunzip_module
What to do if I get nginx command not found error?
Check for nginx path using the [nixmd name=”which”]/whereis command, run:
whereis nginx
which nginx
Look for nginx binary on your Linux or Unix system using PATH:
echo "$PATH"
Use the ps command to grab path for nginx:
ps aux | grep nginx
Once found use full path:
/usr/sbin/nginx -v
sudo /usr/sbin/nginx -v
sudo /usr/local/sbin/nginx -v
Dealing with nginx command not found
Find nginx version using the apt-cache command
Are you using a Debian or Ubuntu Linux server? If so, to check the nginx version, you can use the following command too:
$ apt-cache policy nginx
Find nginx version running on Ubuntu Linux
How do I install Nginx?
See my previous tutorials:
- How To Install Nginx on SUSE Linux Enterprise server 12
- Nginx on OpenSUSE Linux server
- Install and Configure Nginx on Ubuntu Linux 18.04 LTS
- Alpine Linux install Nginx
- Debian 9 install Nginx
- CentOS/RHEL 7 install and set up Nginx
- FreeBSD Install Nginx
Conclusion
This page explains how to find out the version of nginx installed on your systems. The binary has following options:
Option | Description |
---|---|
-?,-h | this help |
-v | display nginx version and exit |
-V | show nginx version and configure options then exit |
-t | test configuration and exit |
-T | test configuration, dump it and exit |
-q | suppress non-error messages during configuration testing |
-s | signal send signal to a master process: stop, quit, reopen, reload |
-p | prefix set prefix path (default: /usr/share/nginx/) |
-c | filename set configuration file (default: /etc/nginx/nginx.conf) |
-g | directives set global directives out of configuration file |
You just learned how to check find nginx web server version using the command line option. For more information see the official nginx webpage here.
🐧 1 comment so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
To check NGINX Version:
sudo nginx -v
sudo nginx -V