Как узнать причину 503

Igor Sysoev is at rambler-co.ru
Mon Dec 8 13:13:07 MSK 2008


On Mon, Dec 08, 2008 at 12:57:13PM +0300, Igor Sysoev wrote:

> On Sun, Dec 07, 2008 at 01:06:14PM +0300, nginx at teratelecom.ru wrote:
> 
> > При использовании нескольких limit_conn и limit_req хотелось бы знать
> > какой из них сработал. В логах только 503. Видимо проще всего создать
> > отдельную переменную, которую затем можно класть в логи.
> 
> Сейчас в error_log пишется причина 503 в случае limit_req.
> Для limit_conn пока не пишется.

Патч.


-- 
Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
Index: src/http/modules/ngx_http_limit_zone_module.c
===================================================================
--- src/http/modules/ngx_http_limit_zone_module.c	(revision 1689)
+++ src/http/modules/ngx_http_limit_zone_module.c	(working copy)
@@ -189,6 +189,9 @@
 
                 ngx_shmtx_unlock(&shpool->mutex);
 
+                ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                              "limiting connections");
+
                 return NGX_HTTP_SERVICE_UNAVAILABLE;
             }
 


More information about the nginx-ru mailing list