comparison src/http/ngx_http_upstream.c @ 5901:7d7eac6e31df

Upstream: support named location for X-Accel-Redirect.
author Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
date Tue, 04 Nov 2014 19:56:23 +0900
parents 5a042519bfe7
children 2f7e557eab5b
comparison
equal deleted inserted replaced
5900:20d966ad5e89 5901:7d7eac6e31df
2216 } 2216 }
2217 } 2217 }
2218 } 2218 }
2219 2219
2220 uri = u->headers_in.x_accel_redirect->value; 2220 uri = u->headers_in.x_accel_redirect->value;
2221 ngx_str_null(&args); 2221
2222 flags = NGX_HTTP_LOG_UNSAFE; 2222 if (uri.data[0] == '@') {
2223 2223 ngx_http_named_location(r, &uri);
2224 if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) { 2224
2225 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); 2225 } else {
2226 return NGX_DONE; 2226 ngx_str_null(&args);
2227 } 2227 flags = NGX_HTTP_LOG_UNSAFE;
2228 2228
2229 if (r->method != NGX_HTTP_HEAD) { 2229 if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
2230 r->method = NGX_HTTP_GET; 2230 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
2231 } 2231 return NGX_DONE;
2232 2232 }
2233 ngx_http_internal_redirect(r, &uri, &args); 2233
2234 if (r->method != NGX_HTTP_HEAD) {
2235 r->method = NGX_HTTP_GET;
2236 }
2237
2238 ngx_http_internal_redirect(r, &uri, &args);
2239 }
2240
2234 ngx_http_finalize_request(r, NGX_DONE); 2241 ngx_http_finalize_request(r, NGX_DONE);
2235 return NGX_DONE; 2242 return NGX_DONE;
2236 } 2243 }
2237 2244
2238 part = &u->headers_in.headers.part; 2245 part = &u->headers_in.headers.part;