
opkg install nginx 执行之后 安装成功 有以下安装包
luci-nginx - git-20.161.73418-219f0ce nginx - 1.19.6-2 nginx-mod-luci - 1.19.6-2 nginx-ssl - 1.19.6-2 nginx-ssl-util - 1.5-1 nginx-util - 1.5-1 但是无法启动,报错 [emerg] 32542#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed
which nginx 后 发现 nginx 可执行文件路径是 /usr/sbin/nginx
/etc/nginx 目录下有这些内容
drwxr-xr-x 2 root root 4096 Mar 14 11:42 conf.d -rw-r--r-- 1 root root 1007 Mar 7 06:06 fastcgi_params -rw-r--r-- 1 root root 2837 Mar 7 06:06 koi-utf -rw-r--r-- 1 root root 2223 Mar 7 06:06 koi-win -rw-r--r-- 1 root root 5231 Mar 7 06:06 mime.types -rw-r----- 1 root root 5798 Mar 7 06:06 naxsi_core.rules -rw------- 1 root root 183 Nov 29 01:34 restrict_locally lrwxrwxrwx 1 root root 23 Mar 14 11:42 uci.conf -> /var/lib/nginx/uci.conf -rw------- 1 root root 699 Nov 29 01:34 uci.conf.template -rw-r--r-- 1 root root 664 Mar 7 06:06 uwsgi_params -rw-r--r-- 1 root root 3610 Mar 7 06:06 win-utf 使用 find / -name nginx.conf 搜不到磁盘内有这个文件,nginx.conf_bak之类的文件也没有,求助……
1 AllenHua OP 换了个固件 已经可以了 |
2 wanmyj 2022-11-11 13:36:25 +08:00 给其他朋友参考,op 的 nginx 的配置用的是 uci ,不用 /etc/nginx/nginx.conf ,用 uci.conf 就可以 https://openwrt.org/docs/guide-user/services/webserver/nginx |