VirtualDocumentRoot with 1.4.2

Kai Hendry hendry at
Tue Aug 27 08:43:12 UTC 2013

Hi there,

I've tried to replicate my Apache VirtualDocumentRoot /srv/www/%0 to

I have with

	server_name ~^(?<vhost>.*)$;
	root /srv/www/$vhost;
	access_log /var/log/nginx/$vhost.access.log;

However it's still logging to /var/log/nginx/access.log instead of

	[root at sg ~]# cd /var/log/nginx/
	[root at sg nginx]# inotifywait -r -m .
	Setting up watches.  Beware: since -r was given, this may take a while!
	Watches established.
	./ MODIFY access.log
	./ MODIFY access.log

`root /srv/www/$vhost;` works, but not `access_log

What am I missing?

Could my configuration upon be otherwise
improved, without breaking it into individual server blocks?

Many thanks,

More information about the nginx mailing list