7

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?

pelican
  • 5,846
  • 9
  • 43
  • 67

4 Answers4

2

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\
brunorcabral
  • 131
  • 1
  • 5
1

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

Mark-VII
  • 371
  • 7
  • 18
1

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

Sasayaku
  • 69
  • 5
0

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

Unicorn24
  • 1
  • 3