Nginx fails to create directories on Windows 10 with error: nginx: CreateFile()...failed

pelican picture pelican · Feb 22, 2016 · Viewed 9.1k times · Source

I need to find a way/setting to allow Nginx to run a .bat file that will create directories and files via a WINDOWS service; my OS is Windows 10. Currently, our windows service fails to create directories and files with the following:

CreateFile() "C:\someForlderName\build\distribution.\nginx/logs/error.log" failed (3: The system cannot find the path specified)

Somehow Nginx doesn't have enough permissions to perform write-access operations like creating directories such as /logs/ and /temp/ within the /Nginx/ directory.

Anybody ran into this problem before?

Answer

Mark-VII picture Mark-VII · Dec 27, 2017

I was facing the same problem, sharing the thing that worked for me.

Nginx is showing this error because... nginx didn't find the error.log file..

For that, Go to you nginx folder where other folders like conf, docs, html etc are their as.

Nginx folder structure

Create folder name logs, and in that folder create a file name error.logas.

error.log file