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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章