NGINX looks for /logs/error.log as default?

Hello, I have a problem with NGINX version 1.2.4 it will constantly look
for /logs/error.log, even though I have defined another error.log in my
configuration.

I start NGINX like this:
nginx -p . -c config/nginx/development.conf

My development.conf is fairly simple and looks like this:

main error log

error_log log/nginx.error.log debug;
worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

main access log

access_log log/nginx.access.log combined;

sendfile on;

keepalive_timeout 65;

server {
listen 9002; #omg!
server_name local.woman.dk;

rewrite ^/(.*)/$ /$1 last;

proxy_set_header  X-Real-IP  $remote_addr;
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_max_temp_file_size  0;

location / {
  ssi on;
  proxy_pass http://127.0.0.1:3000;
}

}
}

But NGINX don’t want to start because ./logs/error.log doesn’t exist.
This
is my error:

[ben2 (master)]=> nginx -p . -c config/nginx/development.conf
nginx: [alert] could not open error log file: open() “./logs/error.log”
failed (2: No such file or directory)

Am I doing it wrong?

On 22 Oct2012, at 16:01 , Kasper G. [email protected] wrote:

Am I doing it wrong?

Nginx have to write log even before it read config file, so nginx try to
open file specified
by --error-log-path or relative to --prefix configure options.

On Monday 22 October 2012 16:01:17 Kasper G. wrote:

Hello, I have a problem with NGINX version 1.2.4 it will constantly look
for /logs/error.log, even though I have defined another error.log in my
configuration.
[…]
But NGINX don’t want to start because ./logs/error.log doesn’t exist. This
is my error:

[ben2 (master)]=> nginx -p . -c config/nginx/development.conf
nginx: [alert] could not open error log file: open() “./logs/error.log”
failed (2: No such file or directory)

Am I doing it wrong?

Nginx must have access to error log before it will parse configuration.
See also the “–error-log-path=” configure parameter.
http://www.nginx.org/en/docs/install.html

wbr, Valentin V. Bartenev

http://nginx.org/en/donation.html

2012/10/22 Valentin V. Bartenev [email protected]

nginx: [alert] could not open error log file: open() “./logs/error.log”

Technical Support for NGINX and NGINX Plus Software
nginx: donation


nginx mailing list
[email protected]
nginx Info Page

Oh, that makes sense. Then I am not able to make a smart setup that I
wanted. Thanks for your email.