I wanted to do this too, but apparently by design nginx cannot expand variables in the error_log
command, in case there are errors doing so and it cannot get a log filename to write them to.
Their suggestion is to use some program to generate your configuration files instead. You could use sed
for this, to automatically search-and-replace your own variables and placing the output in the nginx configuration directory.