[Solved] could not open error log file: CreateFile() “logs/error.log“ fail

Use the following command on the window to start nginx and report an error

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" fail
ed (3: The system cannot find the path specified)
2022/04/24 20:57:16 [warn] 2880#1980: the "ssl" directive is deprecated, use the
 "listen ... ssl" directive instead in D:\nginx-1.18.0/conf/proxy-to-http.conf:53
2022/04/24 20:57:16 [emerg] 2880#1980: CreateFile() "D:\nginx-1.18.0/logs/access
.log" failed (3: The system cannot find the path specified)

nginx -c ./conf/nginx.conf
1. First check the location where the current command is executed. If not,
solution:
delete all files under logs and then execute the above command

Read More: