November 02, 2010 05:33AM
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


Подскажите, где я ошибаюсь?
Subject Author Posted

Ограничить location uri+агрументы через limit_req

igor.goncharenko November 02, 2010 05:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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