Per this post on the nginx.org mailing list (extract quoted below), the %%ERROR_LOG_PATH%%
is set as a compile option, and checked immediately on startup, causing the "Could not open" alert. Specifying the prefix (with -p
) may help suppress the alert, but only if the %%ERROR_LOG_PATH%%
was specified as a relative path at compile time.
You can check how it is specified in your current executable with
nginx -V 2>&1 | grep -oE 'error-log-path=\S*'
That is why the solution proposed by @Michael works for some, but not for others.
See changelog:
Changes with nginx 0.7.53
...
*) Change: now a log set by --error-log-path is created from the very
start-up.
*) Feature: now the start up errors and warnings are outputted to an
error_log and stderr.
...
Now compiled in error_log value always used to log errors at start
time (and emits warning if nginx can't open it). Once config file
have been read - error_log from config will be used instead.
If you have compiled nginx with error_log path relative to prefix
- it should be possible to override startup error_log via -p
switch.
Maxim Dounin