安装后 Nginx 无法启动 [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file

时间:2021-01-08 15:18:32

标签: ubuntu nginx

在 Ubuntu 上安装 Nginx 后,它没有启动。我不知道发生了什么。我尝试自己创建 nginx.conf 但没有发生任何变化

    ● 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 Fri 2021-01-08 15:12:18 UTC; 1min 49s ago
     Docs: man:nginx(8)

Jan 08 15:12:18 root systemd[1]: Starting A high performance web server and a reverse proxy server...
Jan 08 15:12:18 root nginx[3367]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or d
Jan 08 15:12:18 root nginx[3367]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 08 15:12:18 root systemd[1]: nginx.service: Control process exited, code=exited status=1
Jan 08 15:12:18 root systemd[1]: nginx.service: Failed with result 'exit-code'.
Jan 08 15:12:18 root systemd[1]: Failed to start A high performance web server and a reverse proxy server.

1 个答案:

答案 0 :(得分:0)

我不知道,但是在我从 this link 复制了 /etc/nginx 中的 nginx.conf 和 mime.types 之后它可以工作。谢谢@Daniel Mesa