Separate Log for Robot Page Access
Wohbah
2947779 at deadaddress.com
Sat Feb 6 11:31:41 MSK 2010
To record robots in another log I have a boolean $is_robot. The variable is
set correctly. But I can't use it. (nginx version 0.765-1)
Why can I do
if ( ... ) { ... access_log off; ... }
but not
if ( ... ) { ... access_log /var/log/nginx/robots.log; ... }
When a robot visits, it gets error 500. No web page. Must I duplicate
every location to change access_log settings? Here is the topmost one:
location / {
access_log /var/log/nginx/access.log;
...much stuff I do not like duplicating, several lines...
if ( $is_robot ~ T ) {
access_log /var/log/nginx/robots.log;
}
try_files /maintenance.html $uri.html @phptry ;
}
--
View this message in context: http://n2.nabble.com/Separate-Log-for-Robot-Page-Access-tp4524448p4524448.html
Sent from the nginx mailing list archive at Nabble.com.
More information about the nginx
mailing list