Re:

Yuriy Taraday yorik.sar gmail.com
7 09:42:31 MSD 2010


map    -.
http://sysoev.ru/nginx/docs/http/ngx_http_map_module.html#map

2010/5/7 Kirill Pekarov <orion_ at mail.ru>:
>  .
>
>    .
>
> ,   ,        
>    .     ,  nginx 
> .
>
> ,   ,      
>    .     ? 
>      -?  ,   .
>
> !
>
> nginx version: nginx/0.6.32
>
>   .
>
>
>
>
> server {
>  listen  127.0.0.1:80;
>  server_name www.mysite.com mysite.com;
>
>  access_log /var/log/nginx/mysite_access.log;
>  error_log /var/log/nginx/mysite_error.log;
>
>   #   back-end
>  location / {
>
>    #  
>    if ($http_user_agent ~ Yahoo)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Nutch)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Twiceler)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ ia_archiver)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ DotBot)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ "Ask Jeeves")
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ "Speedy Spider")
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Exabot)
>    {
>        return 503;
>    }
>
>    proxy_pass http://backend;
>    include   /etc/nginx/proxy.conf;
>  }
>
>  #     nginx
>  # back-end    
>  location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js)$ {
>
>     #  
>    if ($http_user_agent ~ Yahoo)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Nutch)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Twiceler)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ ia_archiver)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ DotBot)
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ "Ask Jeeves")
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ "Speedy Spider")
>    {
>        return 503;
>    }
>
>    if ($http_user_agent ~ Exabot)
>    {
>        return 503;
>    }
>
>    root /var/www/mysite/;
>    expires max;
>    add_header Cache-Control public;
>  }
>
> }
>
>
>
> --
> With best regards
> Kirill             mailto:orion_ at mail.ru
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>


nginx-ru