Using $upstream_response_time in add_header shows a dash
nginx-forum at forum.nginx.org
Fri Feb 5 20:38:16 UTC 2021
I have this example nginx.conf:
reproduce the behavior.
I start nginx and an example upstream with:
python3 -u -m http.server 8001 > app.log 2>&1 & sudo nginx > nginx.log 2>&1
Upon hitting nginx with `curl -i localhost:8000`, I see these response
`cat app.log` shows that upstream was hit successfully, and `cat nginx.log`
shows that nginx knows the $upstream_response_time at log time, as I get
127.0.0.1:8001 200 0.004
Why does nginx substitute the request time and relevant response metadata
(like $upstream_status) at add_header time successfully, yet substitutes the
upstream response time with a dash?
My goal with returning $upstream_response_time in a header is so the client
can know how much of their request latency was due to their upload speeds
vs. server processing time.
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,290674,290674#msg-290674
More information about the nginx