先把cmd的报错信息粘出来
nginx: [alert] could not open error log file: CreateFile() “logs/error.log” failed (3: The system cannot find the path specified)
2023/11/29 11:27:37 [emerg] 5040#18772: CreateDirectory() “D:\enviroment\nginx-1.24.0\conf/temp/client_body_temp” failed (3: The system cannot find the path specified)
在windows下安装nginx,安装在D:\enviroment\nginx-1.24.0
启动nginx时我是进入到conf目录下启动的
D:\enviroment\nginx-1.24.0\conf>nginx -c nginx.conf
所以出现了报错信息
细读报错信息会发现其实启动的时候要在nginx根目录下。
D:\enviroment\nginx-1.24.0>nginx -c ./conf/nginx.conf
使用 localhost:80启动(80端口是我自己配置的)