Welcome! Log In Create A New Profile

Advanced

Using dynamic access_log, automatically create parent directory

July 26, 2015 10:49PM
We use a dynamic value for access logs:

access_log /var/log/nginx/domains/$host/access.log main;

However, if the $host directory does not exist in /var/log/nginx/domains nginx fails with an error creating the access log. Is there a way to have nginx create the $host directory automatically instead of failing?

Seems like this should be default behavior?
Subject Author Posted

Using dynamic access_log, automatically create parent directory

justink101 July 26, 2015 10:49PM

Re: Using dynamic access_log, automatically create parent directory

Francis Daly July 28, 2015 06:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
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