Welcome! Log In Create A New Profile

Advanced

nginx not starting because of bad/missing path to access_log

Boyko Yordanov
October 07, 2011 07:34AM
Hi,

Just want to point this case where nginx won't start and eventually suggest a feature to avoid this situation.

nginx vhost is configured with the following directive:

access_log /domhome/some-random-domain.com/logs/access_log main;

where /domhome/some-random-domain.com/logs/access_log is in fact a symlink:

# ls -la /domhome/some-random-domain.com/logs/access_log
lrwxrwxrwx 1 root root 46 Oct 2 05:31 /domhome/some-random-domain.com/logs/access_log -> /domhome/some-random-domain.com/logs/2011/10/access_log

The case is that if some folder in the path does not exist, e.g. the folder 2011 is missing, or 10 is missing, then nginx won't be able to follow the symlink and create the access_log. It will just refuse to start with the following error in the log:

2011/10/07 13:21:12 [emerg] 9105#0: open() "/domhome/some-random-domain.com/logs/access_log" failed (2: No such file or directory)

Can this behavior be adjusted, so that nginx creates all the folders in the path and create the access_log itself, and start normally as expected? Or is this inappropriate, and if so, why?

Thanks,

Boyko
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx not starting because of bad/missing path to access_log

Boyko Yordanov October 07, 2011 07:34AM

Re: nginx not starting because of bad/missing path to access_log

Brian Akins October 07, 2011 04:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready