Welcome! Log In Create A New Profile

Advanced

Re: Ограничить location uri+агрументы через limit req

Лазовский Вадим
November 02, 2010 05:54AM
02.11.2010 12:33, igor.goncharenko пишет:
> Hi!
>
> Подскажите, как установить лимит для
> таких запросов:
> "http://test.host/index.php?command=test_commandPHPSESSION={php session
> id}"
>
> Я сделал location, но он не работает, скорее
> всего потому, что location работает с uri:
>
> location ~* ^/index.php\?command=test_command&PHPSESSID=
> {
> proxy_pass http://test.loc;
> limit_req zone=test1 burst=5 nodelay;
> }
>
>
> Попробовал через if в location /:
>
> location /
> {
> proxy_pass http://test.loc;
>
> if ($request_uri ~* "^/index.php\?command=test_command&PHPSESSID=")
> {
> limit_req zone=test1 burst=5 nodelay;
> }
>
> }
>
> но тоже не работает:
> # nginx -t
> [emerg]: "limit_req" directive is not allowed here in
> /usr/local/etc/nginx/test.loc:33
>
>
> Подскажите, где я ошибаюсь?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,146826,146826#msg-146826
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru

А если так?

location / {
error_page 417 = @limit;

if ($arg_sessid) {
return 417;
}
}

location @limit {
limit_req ...;
}

--
С уважением,
Лазовский Вадим

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Re: Ограничить location uri+агрументы через limit req

Лазовский Вадим November 02, 2010 05:54AM

Re: Ограничить location uri+агрументы через limit req

igor.goncharenko November 02, 2010 10:32AM

Re: Ограничить location uri+агрументы через limit req

igor.goncharenko November 04, 2010 03:48AM

Re: Ограничить location uri+агрументы через limit req

Maxim Dounin November 04, 2010 05:50AM

Re: Ограничить location uri+агрументы через limit req

igor.goncharenko November 05, 2010 10:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
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