You have to write your own module (which has some tricks to get hole POST, refer to echo or lua modules.). Or use lua module. Somewhere in maillist were examples how to do it. But on production loads lua can have memory leaks. Maxim. 2011/7/19 Anatoli Marinov <toli@webforge.bg>: > Hello colleagues, > I am wondering is it possible to receive whole post data in a handler > module?by magz - Nginx Development
>Additional flag to ngx_http_subrequest() can't help if you aren't >even going to execute subrequests (as in filter finalization case) >and can't help with ssi either, as subrequests are executed after >main request already cleared request body. >Maxim Dounin Hm. I skipped this part. Sorry. If it's flag in struct ngx_http_request_s() then you can control inside your moduby magz - Nginx Mailing List - English
Forgot include the check to the patch :) cat ngx_keep_tempfile_flag.patch diff -Nuarp nginx-0.9.5/src/http/ngx_http_core_module.c nginx-0.9.5_new/src/http/ngx_http_core_module.c --- nginx-0.9.5/src/http/ngx_http_core_module.c 2011-01-20 07:31:24.000000000 -0800 +++ nginx-0.9.5_new/src/http/ngx_http_core_module.c 2011-03-09 07:22:45.000000000 -0800 @@ -2230,6 +2230,7 @@ ngx_http_subrequestby magz - Nginx Mailing List - English
Something like that. So we can do: rc = ngx_http_subrequest(r, &subreq_loc , &args, &sr, psr, NGX_HTTP_REQUEST_KEEP_TEMP_FILE); # cat ngx_keep_tempfile_flag.patch diff -Nuarp nginx-0.9.5/src/http/ngx_http_core_module.c nginx-0.9.5_new/src/http/ngx_http_core_module.c --- nginx-0.9.5/src/http/ngx_http_core_module.c 2011-01-20 07:31:24.000000000 -0800by magz - Nginx Mailing List - English
Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Tue, Mar 08, 2011 at 03:24:47PM -0500, magz > wrote: > > > Hello, > > > > Is it reasonable to add following check to not > clean/discard fd in case > > if it's sub request? > > > > I developed nginx module and when it started to > usby magz - Nginx Mailing List - English
Hello, Is it reasonable to add following check to not clean/discard fd in case if it's sub request? I developed nginx module and when it started to use tmp buffers under load I had following error: 29663#0: *45789 sendfile() failed (9: Bad file descriptor) while sending request to upstream, client: 10.1.24.14, server: hss, request: "POST So that sub-request cleared file before mby magz - Nginx Mailing List - English
Is there any ways to catch memory leak in nginx? I run valgrind and it does not catch anything. I wrote module which sends sub-request to different location, reads response to variable. Then I check this variable in config file and do, or not do rewrite original url. At the run nginx eats about 150Mb but after day working on load it grows to 300Mb. I run valgrind on test machine but there wereby magz - Nginx Mailing List - English
r->count--; to the right place fixed my problem. Thanks agentzh again!by magz - Nginx Mailing List - English
agentzh Wrote: ------------------------------------------------------- > On Mon, Feb 28, 2011 at 2:33 PM, magz wrote: > > magz Wrote: > > > -------------------------------------------------- > ----- > >> Hi, > >> > >> I have strange problem with main request hand > if > >> I call for sub-request. Maybe somebody can > hby magz - Nginx Mailing List - English
magz Wrote: ------------------------------------------------------- > Hi, > > I have strange problem with main request hand if > I call for sub-request. Maybe somebody can help > me with it? > > I do spam filtering in post request. So I added > location to nginx.conf and call sub-request for > that location. Then read output from sub-request > and setby magz - Nginx Mailing List - English
Hi, I have strange problem with main request hand if I call for sub-request. Maybe somebody can help me with it? I do spam filtering in post request. So I added location to nginx.conf and call sub-request for that location. Then read output from sub-request and set up nginx variable according to output. So config looks like: location = /checkspam { intby magz - Nginx Mailing List - English
magz Wrote: ------------------------------------------------------- > Подскажите пожалуйста как > правильно делать редирект > реквеста. > > Пробовал так: > r->uri.data = new_uri; > r->uri.len = new_uri_size; > r->headers_in.server.data = new_host; > r->headers_in.serveby magz - Nginx Mailing List - Russian
Подскажите пожалуйста как правильно делать редирект реквеста. Пробовал так: r->uri.data = new_uri; r->uri.len = new_uri_size; r->headers_in.server.data = new_host; r->headers_in.server.len = new_host_size; И вот так: uri.data = new_uri; uri.len = new_uri_size; ngx_http_inteby magz - Nginx Mailing List - Russian
Здравствуйте, Подскажите пожалуйста как лучше сделать обработчик для POST запросов, в том случае если обработка запроса длится какое-то существенное время? Регистрирую его вот так: h = ngx_array_push(&cmcf->phases.handlers); *h = ngby magz - Nginx Mailing List - Russian
Урам, всем спасибо большое, по ходу дела заработало. Я сделал в контексте флаг ctx->done , внутри хендлера его выствляю и делаю так: ctx->done = 1; r->read_event_handler = ngx_http_request_empty_handler; r->write_event_handler = ngx_http_core_run_phases; /*?*/ ngx_htby magz - Nginx Mailing List - Russian
Valery Kholodkov Wrote: ------------------------------------------------------- > magz пишет: > >> r->request_body_in_single_buf = 1; > >> rc = ngx_http_read_client_request_body(r, > ngx_http_my_body_handler); > > > > При установке > request_body_in_single_buf в 1, в rc > > возвращается NGX_AGAIN. Что нby magz - Nginx Mailing List - Russian
>r->request_body_in_single_buf = 1; >rc = ngx_http_read_client_request_body(r, ngx_http_my_body_handler); При установке request_body_in_single_buf в 1, в rc возвращается NGX_AGAIN. Что на сколько я понимаю означает что не полностью заполнился буфер r->request_body->bufby magz - Nginx Mailing List - Russian
Здравствуйте, подскажите пожалуйскта как правильно считать пост реквест в буффер. Я нашел модуль form_input там через функции NDK делается регистрируется handler так: value = cf->args->elts; filter.func = ngx_http_set_form_input; return ndk_set_var_multi_valby magz - Nginx Mailing List - Russian