🐧

Nginx · systemctl · journalctl

Web server, systemd services, and log troubleshooting on Linux.

Related: nginx · apache · haproxy · postfix

Nginx

CommandDescription
sudo nginx -tTest config syntax
sudo systemctl reload nginxReload without dropping connections
sudo tail -f /var/log/nginx/error.logError log stream
curl -I http://localhostCheck HTTP response headers

systemctl

CommandDescription
sudo systemctl status nginxService state and recent logs
sudo systemctl start|stop|restart nginxControl service
sudo systemctl enable nginxStart on boot
sudo systemctl list-units --type=service --state=failedFailed services

journalctl

CommandDescription
sudo journalctl -u nginx -fFollow service logs
sudo journalctl -u nginx --since "1 hour ago"Logs since time
sudo journalctl -p err -bErrors since last boot
sudo journalctl -xeRecent entries with hints