nginx: [emerg] 的問題及解決方法

問題1 :nginx: [emerg] "server" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:1
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

解決方法:server 標籤需要在 http的標籤內  

正確的配置寫法 : http {

server {}

}

問題2: nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

解決方法:執行  /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

問題3:nginx: [emerg] no "events" section in configuration

解決方法:在nginx.conf  添加  

events {
    worker_connections  1024;
}

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