weixin_42605365
Anele.L
2019-10-30 15:42

nginx启动报错 Failed to start A high performance web server and a reverse proxy server.

5
  • python
  • ubuntu
  • linux
root@tedu:/etc/nginx/sites-enabled# vim default

修改了default文件

location/static{
          root /home/tarena/Download/ajax_day01_all/ajax_day01_all/mysite8;
        }

增加了静态地址 分号没有漏掉

sudo /etc/init.d/nginx restart

运行报错
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since 三 2019-10-30 14:36:12 CST; 13min ago
Process: 13022 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exite
Process: 12334 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 13098 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 12338 (code=exited, status=0/SUCCESS)

10月 30 14:36:12 tedu systemd[1]: Starting A high performance web server and a reverse proxy server...
10月 30 14:36:12 tedu nginx[13098]: nginx: [emerg] unknown directive "location/static" in /etc/nginx/sites-enabled/de
10月 30 14:36:12 tedu nginx[13098]: nginx: configuration file /etc/nginx/nginx.conf test failed
10月 30 14:36:12 tedu systemd[1]: nginx.service: Control process exited, code=exited status=1
10月 30 14:36:12 tedu systemd[1]: Failed to start A high performance web server and a reverse proxy server.
10月 30 14:36:12 tedu systemd[1]: nginx.service: Unit entered failed state.
10月 30 14:36:12 tedu systemd[1]: nginx.service: Failed with result 'exit-code'.
~
~

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答

为你推荐

换一换