Nginx加载配置文件重启及问题解决方案

检查配置文件是否正确:./nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

利用配置文件启动nginx:

nginx -c /etc/nginx/nginx.conf

注意

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

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

解决方案

lsof -f:80

kill掉对应的http的pid

重新装载配置文件:

nginx -s reload

 

 

你可能感兴趣的:(分布式)