Symptome

  • systemctl status nginx zeigt failed oder inactive.
  • curl http://127.0.0.1 scheitert; Log: Address already in use auf Port 80.

Wahrscheinliche Ursachen

  • Portbelegung, Syntaxfehler in nginx-Config, falsche Rechte auf Zertifikat/DocumentRoot, volle SD-Karte.

Standardlösung

  1. sudo systemctl status nginx --no-pager und sudo journalctl -u nginx -n 40 --no-pager
  2. sudo nginx -t
  3. sudo ss -tlnp | grep ':80 '
  4. Letzte Änderung zurücknehmen, dann sudo systemctl restart nginx

Erweiterte Diagnose

sudo tail -n 80 /var/log/nginx/error.log
sudo lsof -i :80
bind() to 0.0.0.0:80 failed (98: Address already in use)

Notfallhinweis

Bei Datenverlust-Risiko: zuerst Backup; keine hastigen Formatierungen.