Nginxexit code > 0

nginx: [emerg] bind() failed: Address already in use

$nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Analysis

Nginx cannot start because port 80 (or 443) is already occupied by another process.

Common Triggers

  • Apache is running on the same server.
  • Another instance of Nginx is already running (zombie process).

Debug Checks

  • $Find the process: sudo lsof -i :80.

Resolution

1
Stop the conflicting service.
2
Kill the zombie process.

Metadata

Tool
Nginx
Severity
High
Tags
#nginx#web#port