30 Useful NGINX Administration Commands

NGINX is a powerful web server and reverse proxy that is widely used in the industry. As an administrator, it is important to have a solid understanding of the NGINX configuration and how to manage it efficiently. In this list, we have compiled 30 useful NGINX administration commands that can help you with tasks such as checking the status of your server, managing your SSL certificates, and more. By having these commands at your disposal, you can ensure that your NGINX server is running smoothly and securely.

nginx -v – Check the version of NGINX installed.

nginx -t – Test the NGINX configuration file for syntax errors.

systemctl start nginx – Start the NGINX service using Systemd.

systemctl stop nginx – Stop the NGINX service using Systemd.

systemctl restart nginx – Restart the NGINX service using Systemd.

systemctl reload nginx – Reload the NGINX configuration without stopping the service using Systemd.

systemctl status nginx – Check the status of the NGINX service using Systemd.

journalctl -u nginx.service – View the NGINX service logs using Systemd.

netstat -tulpn | grep nginx – List all network connections established by the NGINX process.

nginx -s reload – Reload the NGINX configuration file without stopping the service.

sudo nginx -s reopen – Reopen the NGINX log files.

sudo nginx -s stop – Gracefully stop the NGINX service.

sudo nginx -s quit – Stop the NGINX service immediately.

sudo nginx -s reload – Reload the NGINX configuration without stopping the service.

sudo nginx -s reopen – Reopen the NGINX log files.

sudo nginx -t – Check the NGINX configuration file for syntax errors.

sudo nginx -V – Display the NGINX version and compilation information.

sudo systemctl enable nginx – Enable NGINX to start on boot using Systemd.

sudo systemctl disable nginx – Disable NGINX from starting on boot using Systemd.

sudo systemctl reload nginx – Reload the NGINX configuration without stopping the service using Systemd.

sudo systemctl restart nginx – Restart the NGINX service using Systemd.

sudo systemctl start nginx – Start the NGINX service using Systemd.

sudo systemctl stop nginx – Stop the NGINX service using Systemd.

sudo systemctl status nginx – Check the status of the NGINX service using Systemd.

sudo journalctl -u nginx – View the NGINX service logs using Systemd.

sudo systemctl edit nginx – Edit the NGINX service unit file using Systemd.

sudo systemctl cat nginx – View the NGINX service unit file using Systemd.

sudo systemctl list-unit-files | grep nginx – List all NGINX service unit files using Systemd.

sudo systemctl daemon-reload – Reload the Systemd daemon configuration.

sudo nginx -s signal – Send a signal to the NGINX master process.

Leave a Reply

Scroll to top