gmm at csdoc.com
Tue Feb 11 09:40:32 UTC 2014
On 11.02.2014 11:04, Ruslan Ermilov wrote:
>> I am using
>> add_header x-responsetime $upstream_response_time;
>> to report response times of the back-end to the client. I was
>> expecting to see the back-end response time (e.g. 0.500 for half a
>> second), however the headers that I am getting contain an epoch
>> timestamp, e.g:
>> x-responsetime: 1392070197.589
>> What am I doing wrong?
may be better set default value of variable $upstream_response_time
to url on site nginx.org with faq/documentation, something like this:
The $upstream_response_time is only meaningful once response is
fully got from upstream, and this happens after response headers
are got (and sent to client). That is, you basically can't use
$upstream_response_time in add_header, only in logs.
or, if only number allowed, some fail-safe value, for example, -1 or 0.
More information about the nginx