Welcome! Log In Create A New Profile

Advanced

Re: if в location для access_log.

Serg Senko
April 07, 2011 07:52AM
Странно, почистил все и перекопал, а лог не пишется чепез If
У кого нить он пишится через if ?

location / {
include conf/inc/rewrite.rules;
root /tmpfs;
expires 24h;
try_files $uri $uri/ @fetch;

location ~* nc_.+\.(js|css)$ {
root /tmpfs;
try_files $uri $uri/ @fetch;
expires 0;
}


if ($http_user_agent ~ "^(Yandexbot|Googlebot)") {
access_log /usr/local/nginx/logs/seo.log;
}

}


2011/4/6 Igor Sysoev <igor@sysoev.ru>

> On Wed, Apr 06, 2011 at 01:56:48PM +0200, Serg Senko wrote:
> > День добрый
> >
> > Пытаюсь создать отдельные логи для ботов.
> > nginx version: nginx/0.8.53
> >
> > В location'ы прописываю
> >
> > if ($http_user_agent ~ "^(YandexBot|Googlebot)") {
> > access_log /usr/local/nginx/logs/seo.log;
> > }
> >
> >
> > В http {
> >
> > Прописан общий лог
> >
> > access_log /usr/local/nginx/logs/access.log;
> >
> >
> > Логи SEO остаются пустыми, хотя в общем логе вижу ботов которых и пытаюсь
> > отловить и засунуть в отдельный лог.
> >
> > чем проблема может быть ?
>
> Скорее всего, в том, что после этого идёт ещё один if.
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>



--
ttyv0 "/usr/libexec/gmail Pc" webcons on secure
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

if в location для access_log.

Serg Senko April 06, 2011 07:58AM

Re: if в location для access_log.

Igor Sysoev April 06, 2011 08:04AM

Re: if в location для access_log.

Serg Senko April 06, 2011 08:24AM

Re: if в location для access_log.

Serg Senko April 07, 2011 07:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready