先查看端口占用

netstat -ntlp

杀死进程

fuser -k 80/tcp

fuser -k 443/tcp

重启nginx

service nginx restart