Nginx 错误致命
bind() to 0.0.0.0:80 failed (98: Address already in use)bind() to 0.0.0.0:80 failed (98: Address already in use) — 端口已被占用
Nginx 无法绑定到指定的地址和端口。
nginxserver
导致此错误的原因
另一个进程(Apache、其他 Nginx 实例或其他服务)已在相同端口上监听。
如何修复
使用 ss -tlnp 或 netstat -tlnp 找出冲突进程,停止该进程或修改 Nginx 的 listen 端口。
示例
# Find process using port 80
sudo lsof -i :80
sudo ss -tlnp | grep :80
# Stop conflicting service
sudo systemctl stop apache2相关错误代码
Nginx 错误错误
no resolver defined to resolveno resolver defined to resolve — 未配置 DNS 解析器
Nginx 需要解析主机名,但未配置 DNS 解析器。
nginxserver
查看详情 Nginx 错误错误
connect() failed (111: Connection refused)connect() failed (111: Connection refused) — 上游连接被拒绝
Nginx 无法连接到上游服务器。
nginxserver
查看详情 Nginx 错误错误
could not build server_names_hashcould not build server_names_hash — 服务器名称哈希表构建失败
Nginx 无法构建服务器名称哈希表。
nginxserver
查看详情 Nginx 错误错误
no live upstreams while connecting to upstreamno live upstreams while connecting to upstream — 所有上游服务器均已宕机
上游服务器池中的所有服务器均被标记为不可用。
nginxserver
查看详情 Nginx 错误错误
496 SSL Certificate Required496 SSL Certificate Required — Nginx 需要 SSL 证书
服务器要求客户端证书,但客户端未提供。
nginxserver
查看详情 Nginx 错误错误
414 URI Too Long414 URI Too Long — Nginx URI 过长
请求 URI 超过了 Nginx 可处理的最大长度。
nginxserver
查看详情