Hello,
As part of my proxy integration with Oracle coherence cache server, I am using ngx.location.capture to receive the body response and set it to coherence server. It works fine except access log has upstream_response_time value as -. How can I set the upstream_response_time value to be actual value taken while accessing location /upstream?
<code>
location / {
local upstream_result = ngx.location.capture("/soap_upstream" .. ngx.var.request_uri ,
{method = ngx.HTTP_POST, body=ngx.req.get_body_data(),copy_all_vars = true})
local cache_value = {}
cache_value.status = upstream_result.status
cache_value.headers = upstream_result.header
cache_value.body = upstream_result.body
local json_val = utils.lua_to_json(cache_value)
local upstream_result = ngx.location.capture("/coherence_put" .. "/" .. cache_key ,
{method = ngx.HTTP_PUT, body= json_val, copy_all_vars = true})
}
location /upstream {
internal;
rewrite_by_lua '
local uri = ngx.re.sub(ngx.var.uri, "^/soap_upstream/(.*)", "/$1", "o")
ngx.req.set_uri(uri)
';
proxy_pass $upstream_uri;
}
location /coherence_put {
internal;
rewrite_by_lua '
local uri = ngx.re.sub(ngx.var.uri, "^/coherence_put/(.*)", "/$1", "o")
ngx.req.set_uri(uri)
';
proxy_method PUT;
proxy_pass $upstream_uri;
}
</code>