mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Upstream: support named location for X-Accel-Redirect.
This commit is contained in:
parent
a9d9b09103
commit
d9f5baa0b8
@ -2218,6 +2218,11 @@ ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
||||
}
|
||||
|
||||
uri = u->headers_in.x_accel_redirect->value;
|
||||
|
||||
if (uri.data[0] == '@') {
|
||||
ngx_http_named_location(r, &uri);
|
||||
|
||||
} else {
|
||||
ngx_str_null(&args);
|
||||
flags = NGX_HTTP_LOG_UNSAFE;
|
||||
|
||||
@ -2231,6 +2236,8 @@ ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
||||
}
|
||||
|
||||
ngx_http_internal_redirect(r, &uri, &args);
|
||||
}
|
||||
|
||||
ngx_http_finalize_request(r, NGX_DONE);
|
||||
return NGX_DONE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user