# Nginx not starting because of bad/missing path to access\_log

**URL:** <https://www.ruby-forum.com/t/nginx-not-starting-because-of-bad-missing-path-to-access-log/212598>\
**Category:** NGINX\
**Created:** [October 7, 2011, 1:33pm UTC](https://www.ruby-forum.com/t/nginx-not-starting-because-of-bad-missing-path-to-access-log/212598 "2011-10-07T13:33:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [October 7, 2011, 1:33pm UTC](https://www.ruby-forum.com/t/nginx-not-starting-because-of-bad-missing-path-to-access-log/212598/1 "2011-10-07T13:33:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Boyko\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@Boyko\_Y](https://www.ruby-forum.com/u/Boyko_Y)\
**Post date:** [October 7, 2011, 10:42pm UTC](https://www.ruby-forum.com/t/nginx-not-starting-because-of-bad-missing-path-to-access-log/212598/2 "2011-10-07T22:42:47Z")

</div>

On Fri, Oct 7, 2011 at 7:32 AM, Boyko Y.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

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

Do that in your init script or use some config management tools to do it  
for  
you.
