pelican
pelican

Reputation: 6234

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

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?

Upvotes: 8

Views: 23683

Answers (4)

brunorcabral
brunorcabral

Reputation: 145

If your Nginx is at D:\nginx\nginx.exe, execute this to start nginx

D:\nginx\nginx.exe -c D:\nginx\conf\nginx.conf -p D:\nginx\

Upvotes: 4

Unicorn24
Unicorn24

Reputation: 1

For Nginx on Windows, you need to execute nginx server related command from respective home directory where nginx configuration file is located.

Upvotes: 0

Sasayaku
Sasayaku

Reputation: 79

see the right way in picture.. enter image description here

Upvotes: 2

Mark-VII
Mark-VII

Reputation: 373

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

Upvotes: 1

Related Questions