Tweak proxy_next_upstream based on HTTP method

Branden Visser mrvisser at gmail.com
Fri Jul 5 12:32:38 UTC 2013


Hi all,

I was wondering if there is a way to have different proxy_* rules depending
on the HTTP method? My use case is that I want to be a little more
conservative about what requests I retry for POST requests, as they have an
undesired impact if tried twice after a "false" timeout.

e.g., for GET, I may want to try another when I timeout to the back-end
server after 5s, whereas for a POST request, I may want to simply fail the
POST request after 15s.

I can work around this by doing specific location blocks for each URL, but
having separate defaults based on HTTP method should be easier to maintain.

Thanks,
Branden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130705/91e7512a/attachment.html>


More information about the nginx mailing list