Nginx service not starting on Windows 10 - nginx: [alert] could not open error log file: CreateFile()
You need:
To install nginx/Windows, download the latest mainline version distribution (1.13.8), since the mainline branch of nginx contains all known fixes. Then unpack the distribution, go to the nginx-1.13.8 directory, and run nginx. Here is an example for the drive C: root directory: (Run cmd as administrator)
cd c:\unzip nginx-1.13.8.zipcd nginx-1.13.8start nginx
Go to: http://localhost:80 -> test install
Goback to console cmd: "nginx -s stop"
Run for next time:
- Config with file: "C:\nginx-1.13.8\conf\nginx.conf"
- Open cmd as administrator
- Run bash: "cd C:\nginx-1.13.8"
- Run nginx with bash: "start nginx" . If you run with bash: "nginx", will get trouble for exit nginx.
And
nginx -s stop #fast shutdown
nginx -s quit #graceful shutdown
nginx -s reload #changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes
nginx -s reopen #re-opening log files
Under the directory that you run nginx.exe, try to create a directory named logs, and a file named error.log under log.It should pass this error.
- After downloading zip file, you have unzip.
- Make sure that you dont have nested folder names. You have to copy your folder which has
nginx.exe
file in it, and paste it intoC:/
folder. - While running commands, like
nginx -s stop
, make sure that current your working directory is same as thenginx.exe
file.enter image description here