"access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill tdgh2323 at hotmail.com
Sun Mar 25 22:42:57 UTC 2012


Thanks.. but i think you are not understanding me.. the problem is that the log line is throwing an error. So i cannot log.

This is the line that is throwing that error  if ($log) { access_log  /root/access-selected-slim.log slim; }
I have that line inside my server {} .. thats where i need it.


If i cant do it this way.. how can I do it then?

Mike

> Date: Sun, 25 Mar 2012 23:32:31 +0100
> From: francis at daoine.org
> To: nginx at nginx.org
> Subject: Re: "access_log" directive is not allowed here in... how to do this	properly?
> 
> On Sun, Mar 25, 2012 at 07:21:20PM +0000, Micheal Wolfskill wrote:
> 
> Hi there,
> 
> > Iam trying to log the requests coming from a list of countries into a seperate log file.. 
> 
> > map $geoip_country_code $log {
> >                         default       0;
> >                         CN 1; #"China"
> 
> >                         }
> 
>         access_log logs/$log.log;
> 
> You may want to make the content of $log be more descriptive: "access"
> and "special" instead of 0 and 1, for example.
> 
> Or just log normally, and post-process the file to split based on the
> logged IP address.
> 
> 	f
> -- 
> Francis Daly        francis at daoine.org
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120325/d2b51233/attachment.html>


More information about the nginx mailing list