2011年2月26日星期六

Re: Passing variables to access_log, error_log names

On 26 Fev 2011 21h49 WET, nginx-forum@nginx.us wrote:

> Hello,
>
> I am configuring an automagic virtual hosting on my private machine,
> to serve myself projects which I currently work on. Configuration
> I'm using is like this:
>
> server {
> listen 80;
> server_name ~^(www\.)?(?P[^.]+).mydomain.com$;
> root /home/ajgon/htdocs/$project;
> access_log /var/log/nginx/$project.mydomain.com.access_log main;
> error_log /var/log/nginx/$project.mydomain.com.error_log info;
> include lang/php;
> }
>
> Everything is working as expected - except one thing. I'm getting
> two log files with following names:
> /var/log/nginx/$project.mydomain.com.access_log
> /var/log/nginx/$project.mydomain.com.error_log for any Vhost.
>
> Is there any sollution to make nginx parse the variable and set
> proper log name?

I know that this will work:

access_log /var/log/nginx/$project/mydomain.com.access_log main;
error_log /var/log/nginx/$project/mydomain.com.error_log info;

Placing the variable in the filename doesn't AFAIK.

--- appa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论