Welcome! Log In Create A New Profile

Advanced

How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

June 29, 2009 06:33PM
I am trying to develop a handler module in Nginx 0.7.59 to intercept POST requests and perform internal redirections based on the values in the POST data. The problem is, on larger POST requests (~ > 2KB), ngx_http_read_client_request_body() sometimes returns NGX_AGAIN instead of NGX_OK. I have read at various places that if one receives any other status than NGX_OK that that the module should immediately return that status. I have also read that after getting and returning NGX_AGAIN, NGINX will call your module again after other pending network activity. However, I have tried doing this but my module never gets called again.

What I have resorted to is to perform another ngx_http_read_client_request_body() call if I get an NGX_AGAIN. At least within the module this seems to work, but whenever I have to do this the resulting request to the upstream server always times out. But when I don't get NGX_AGAIN, everything is perfectly fine.

How should I handle these cases where ngx_http_read_client_request_body() returns NGX_AGAIN?

Thanks in advance!
Subject Author Posted

How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

sayeo87 June 29, 2009 06:33PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

Maxim Dounin June 29, 2009 07:21PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

Mike Smith June 29, 2009 07:42PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

sayeo87 June 30, 2009 01:29PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

Valery Kholodkov July 01, 2009 11:52AM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

CarlWang November 07, 2011 11:36AM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

Maxim Dounin November 07, 2011 12:50PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

CarlWang November 07, 2011 11:31PM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

agentzh November 08, 2011 01:58AM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

CarlWang November 08, 2011 10:23AM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

CarlWang November 08, 2011 11:44AM

Re: How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

agentzh November 08, 2011 08:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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