nginx not starting because of bad/missing path to access_log

Boyko Yordanov b.yordanov at
Fri Oct 7 11:32:53 UTC 2011


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/  main;

where /domhome/ is in fact a symlink:

# ls -la /domhome/
lrwxrwxrwx 1 root root 46 Oct  2 05:31 /domhome/ -> /domhome/

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/" 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?



More information about the nginx mailing list