deployment issue (or feature request?) - multiple `include` with `log_format`
nginx at 2xlp.com
Fri Nov 18 18:32:42 UTC 2016
I'm not sure if this is a feature request or just an issue with our deployment...
We host many domains, often partitioned across many configuration files
An issue that has complicated our setup is the `log_format` directive. We use a few variations of a log format (different domain groups need/dont-need different data in the logs) and wanted to centrally manage them in a library of `include` files
The problem is that a `log_format` by any given name can only be declared once, so our configuration can not do this:
log_format app_custom '$remote_addr - [$time_local][$host] $status '...
we either have to preload the log formats in the main config, or just define a custom log_format for each domain.
has anyone dealt with this in the past, and found a good solution for deployments (short of requesting an `include_once` feature)?
More information about the nginx