端口占用怎么办

443端口被占用

443端口被占用后,nginx无法绑定到443,网页/网站直接挂掉,无法访问。

#强制关闭占用443端口的进程

sudo fuser -k 443/tcp

#重启 nginx服务
service nginx restart


网友遇到443端口被占用的情况:

Hi all, I have been trying to bind my nginx to port 443. The config file works fine however when i type sudo nginx i repeatedly get address is in use on the bind. I have then used netstat which claims nginx is using the port yet nginx is actually saying it’s not binding.

/etc/nginx/sites-available$ sudo netstat -pan | grep “:443”
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3448/nginx
/etc/nginx/sites-available$ sudo nginx
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()