Welcome! Log In Create A New Profile

Advanced

proxy_next_upstream and POSTs

Jonathan Leibiusky
May 09, 2011 12:44PM
Hi!
Nginx is great and the way it handles upstream and failed server as well! I
would just like to avoid retrying request when they are POSTs, as POSTs are
no idempotent and my backend can't handle duplicated POSTs right now.
So I started to mess around with the code. What I have in mind is to create
a module that will change the behavior of proxy_next_upstream by just
checking that http method != POST.
I believe it supposed to be really simple.
So a couple of questions for those who are into nginx source code:
1. Is there any good article, blog post, etc, that explain how to create and
test a module?
2. Any good advice on how I should do it? I was thinking on adding the
validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c),
something like:
if (r->method == NGX_HTTP_POST) {
return NGX_DECLINED;
}

If this is OK, how could I do this from a module? So when someone compiles
nginx with this module, he'll have this behavior instead of the standard
one?

Sorry if my questions are dumb.

Jonathan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_next_upstream and POSTs

Jonathan Leibiusky May 09, 2011 12:44PM

Re: proxy_next_upstream and POSTs

Jonathan Leibiusky May 09, 2011 06:38PM

Re: proxy_next_upstream and POSTs

Antoine Bonavita May 10, 2011 03:24AM

Re: proxy_next_upstream and POSTs

Jonathan Leibiusky May 10, 2011 10:10AM

Re: proxy_next_upstream and POSTs

Piotr Sikora May 10, 2011 10:34AM

Re: proxy_next_upstream and POSTs

Jonathan Leibiusky May 10, 2011 10:50AM

Re: proxy_next_upstream and POSTs

Jonathan Leibiusky May 10, 2011 03:32PM

Re: proxy_next_upstream and POSTs

Antoine Bonavita May 11, 2011 04:04AM

Re: proxy_next_upstream and POSTs

agentzh May 12, 2011 06:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready