Difference between revisions of "Nginx.conf"

From wikieduonline
Jump to navigation Jump to search
Line 3: Line 3:
  
  
== Track Application Response time ==
+
== Track Application Response time <ref>https://lincolnloop.com/blog/tracking-application-response-time-nginx/</ref> ==
  
 
1) Add to <code>/etc/nginx/nginx.conf</code>
 
1) Add to <code>/etc/nginx/nginx.conf</code>
Line 19: Line 19:
  
  
:request_time This shows how long Nginx dealt with the request
+
:<code>request_time</code> This shows how long Nginx dealt with the request
:upstream_response_time Gives us the time it took our upstream server (in this case Apache/mod_wsgi) to respond
+
:<code>upstream_response_time</code> Gives us the time it took our upstream server (in this case Apache/mod_wsgi) to respond
:pipe Shows ‘p’ in case the request was pipelined.
+
:<code>pipe</code> Shows ‘p’ in case the request was pipelined.
 
 
  
 
== See also ==
 
== See also ==

Revision as of 10:51, 12 December 2019



Track Application Response time [1]

1) Add to /etc/nginx/nginx.conf

log_format timed_combined '$remote_addr - $remote_user [$time_local] '
    '"$request" $status $body_bytes_sent '
    '"$http_referer" "$http_user_agent" '
    '$request_time $upstream_response_time $pipe';

2) Modify access_log directive to use new format:

access_log /var/log/nginx/yourdomain.com.access.log timed_combined;

[2]


request_time This shows how long Nginx dealt with the request
upstream_response_time Gives us the time it took our upstream server (in this case Apache/mod_wsgi) to respond
pipe Shows ‘p’ in case the request was pipelined.

See also

  • https://lincolnloop.com/blog/tracking-application-response-time-nginx/
  • https://stackoverflow.com/a/39260524
  • Advertising: