Centos7啟動Nginx報錯。

論儘先生發表於2018-10-22
nginx: [emerg] unexpected end of file, expecting ";" or "}" in /usr/local/nginx/conf/nginx.conf:118
[root@localhost sbin]# vim /usr/local/nginx/conf/nginx.conf
[root@localhost sbin]# ./nginx -s reload
nginx: [emerg] directive "index" is not terminated by ";" in /usr/local/nginx/conf/vhost/www.baidu.com.conf:7
[root@localhost sbin]# vim /usr/local/nginx/conf/vhost/www.baidu.com.conf
[root@localhost sbin]# systemctl start tomcat
[root@localhost sbin]# ./nginx -s reload
nginx: [emerg] directive "index" is not terminated by ";" in /usr/local/nginx/conf/vhost/www.baidu.com.conf:7
[root@localhost sbin]# vim /usr/local/nginx/conf/vhost/www.baidu.com.conf

基本上是一些”{ } ;”符號漏了或者多寫了,vim命令定位到報錯的行,修改即可,中途誤改按u恢復,centos7在你修改後啟動不了的情況下做了備份,重新編輯,會提示恢復,輸入命令:r 恢復繼續編輯。


相關文章