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?
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?
Not in stock nginx.
You could create a patch to do it; but I suspect that the overhead of
an extra “mkdir -p”-like call for every log line written would not be
worth it.
If you are willing to rearrange your log file structure such that the
variable part is in the filename, and not a parent directory name,
then stock nginx can help you.
Seems like this should be default behavior?
I think “no”.
But it’s the person who writes the code who has the opinion that
matters;
at least for their local version of nginx.