comparison src/http/ngx_http_upstream.c @ 6467:91c8d990fb45

Upstream: proxy_next_upstream non_idempotent. By default, requests with non-idempotent methods (POST, LOCK, PATCH) are no longer retried in case of errors if a request was already sent to a backend. Previous behaviour can be restored by using "proxy_next_upstream ... non_idempotent".
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 28 Mar 2016 19:50:19 +0300
parents 984687f25998
children 2cd019520210
comparison
equal deleted inserted replaced
6466:984687f25998 6467:91c8d990fb45
3987 3987
3988 u->state->status = status; 3988 u->state->status = status;
3989 3989
3990 timeout = u->conf->next_upstream_timeout; 3990 timeout = u->conf->next_upstream_timeout;
3991 3991
3992 if (u->request_sent
3993 && (r->method & (NGX_HTTP_POST|NGX_HTTP_LOCK|NGX_HTTP_PATCH)))
3994 {
3995 ft_type |= NGX_HTTP_UPSTREAM_FT_NON_IDEMPOTENT;
3996 }
3997
3992 if (u->peer.tries == 0 3998 if (u->peer.tries == 0
3993 || !(u->conf->next_upstream & ft_type) 3999 || ((u->conf->next_upstream & ft_type) != ft_type)
3994 || (u->request_sent && r->request_body_no_buffering) 4000 || (u->request_sent && r->request_body_no_buffering)
3995 || (timeout && ngx_current_msec - u->peer.start_time >= timeout)) 4001 || (timeout && ngx_current_msec - u->peer.start_time >= timeout))
3996 { 4002 {
3997 #if (NGX_HTTP_CACHE) 4003 #if (NGX_HTTP_CACHE)
3998 4004