Re[2]: limit_req только для POST запросов - можно?
Александр Попков
voodoo_alex at mail.ru
Thu Apr 30 20:05:35 MSD 2009
> Точку с запятой забыли после set $ip_method
> "$binary_remote_addr$request_method"
Да, действительно забыл, спасибо.
Добавил её, ругнулось что limit_zone_req нельзя в контексте server, перенес её выше, на http-контекст.
Ругани нет, рестартнул, начал проверять, получается вот что (limit = 1r/s, burst=2)
192.168.0.180 [30/Apr/2009:20:04:18 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:19 +0400] [0.343 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:20 +0400] [1.114 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:21 +0400] [0.132 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:21 +0400] [0.216 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:22 +0400] [0.206 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:22 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 503 555
192.168.0.180 [30/Apr/2009:20:04:37 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:38 +0400] [0.001 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:39 +0400] [0.253 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:40 +0400] [0.110 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:46 +0400] [0.001 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:47 +0400] [0.256 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:48 +0400] [0.566 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:49 +0400] [1.130 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:54 +0400] [0.001 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:04:55 +0400] [0.274 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:55 +0400] [0.209 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:04:55 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 503 555
это с версией 0.7.21, обновился до последней 0.7.53, проверяю дальше:
192.168.0.180 [30/Apr/2009:20:09:37 +0400] [0.001 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:42 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:43 +0400] [0.235 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:44 +0400] [0.277 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:45 +0400] [0.577 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:46 +0400] [0.604 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:51 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
192.168.0.180 [30/Apr/2009:20:09:51 +0400] [0.191 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:09:51 +0400] [0.218 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 0 0
192.168.0.180 [30/Apr/2009:20:09:51 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 503 555
192.168.0.180 [30/Apr/2009:20:10:02 +0400] [0.000 s] "-" [-] test1.devel "POST /test/ HTTP/1.1" 200 260
в итоге 2 вопроса:
1) что за ответы со статусом 0?
2) настройки я круто придумал :) только я забыл что GET они тоже ограничивают... то есть вопрос как ограничить _только_POST_ остаётся открыт...
More information about the nginx-ru
mailing list