Nginx 修改配置文件时出现的错误

2019/07/21 08:20:07 [emerg] 2269#0: unknown directive "server_name " in /usr/local/nginx/conf/nginx.conf:119
2019/07/21 08:25:18 [emerg] 2272#0: unknown directive "       " in /usr/local/nginx/conf/nginx.conf:121
2019/07/21 08:28:42 [emerg] 2274#0: unknown directive "       #" in /usr/local/nginx/conf/nginx.conf:121
2019/07/21 08:30:04 [emerg] 2277#0: unknown directive "       server_name" in /usr/local/nginx/conf/nginx.conf:129
2019/07/21 15:07:20 [notice] 2238#0: signal process started
2019/07/21 16:12:39 [warn] 2288#0: server name "http://192.168.0.102" has suspicious symbols in /usr/local/nginx/conf/nginx.conf:38

[emerg][emerg] 2269#0: unknown directive出现未知指令

  1. 修改usr/local/nginx/config/nginx.config时 保存为原来的UTF-8格式  不能UTF-8 -BOM/ANSI 要和原先格式一致
  2. 结构是
  3. http{

                 server{

                 }

         }

      4[emerg] 2269#0: unknown directive出现未知指令

       一般是出现多了空格和" " 里面的东西

     5 [warn] 2288#0: server name "http://192.168.0.102" has suspicious symbols in

         服务器名“http://192.168.0.102”中有可疑符号 ,server name y一般为域名ww.baidu.con

         也可为IP但为192.168.0.102没有http://

发布了20 篇原创文章 · 获赞 24 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/u010565545/article/details/96768195