We have nginx set up with about 5 domains. Each domain has a specific IP associated with it. When a request comes in on an IP, nginx directs that request to the relevant site, regardless of what domain the request came in on.
For example, our site is parent.com and is on 192.168.1.1. The A record for child.com points to 192.168.1.1. Therefore, nginx will send all requests for child.com to parent.com (Parent.com is running a SaaS setup and detects the requested domain automatically). This all works perfectly fine.
What we want to do now is define an independent log file for each domain. Right now our configuration file defines a static log location. We want to modify this so that the log location is set based on the domain that is accessed.
Our current log directives:
access_log /home/parent/_logs/access.log; error_log /home/parent/_logs/error.log;