Welcome! Log In Create A New Profile

Advanced

Re: блокировка по user-agent + Referer

Sergey Shepelev
November 17, 2010 11:12AM
2010/11/17 hg_04 <nginx-forum@nginx.us>:
> [code]
> if ($http_user_agent ~ Macintosh) {
>        if ($http_referer ~* "domain\.com|domain\.net") {
>                return 503;
>        }
> }
> [/code]
>

http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#if
syntax: if (условие) { ... }
default: нет
context: server, location

if можно записать только внутри server или location. (То есть внутри if нельзя)
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

блокировка по user-agent + Referer

che4 November 17, 2010 09:53AM

Re: блокировка по user-agent + Referer

hg_04 November 17, 2010 11:02AM

Re: блокировка по user-agent + Referer

hg_04 November 17, 2010 11:03AM

Re: блокировка по user-agent + Referer

che4 November 17, 2010 11:09AM

Re: блокировка по user-agent + Referer

Sergey Shepelev November 17, 2010 11:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready