Skip to content

Commit b3c06af

Browse files
author
Leonardo Lorieri
committed
feat(router) nginx status; log http_host, upstream and request times
Improve debug and monitoring When a request come to Deis for an old removed app the request returns 200 making it hard to detect problems, the http_host in the log can help us check if an app exists, upstream and request times helps to detect buggy apps and/or units, stub_status makes possible to check routers balancing and total connections
1 parent 8224a52 commit b3c06af

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

router/image/templates/nginx.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ http {
4444

4545
client_max_body_size {{ or (.deis_router_bodySize) "1m" }};
4646

47-
log_format upstreaminfo '[$time_local] - $remote_addr - $remote_user - $status - "$request" - $bytes_sent - "$http_referer" - "$http_user_agent" - "$server_name" - $upstream_addr';
47+
log_format upstreaminfo '[$time_local] - $remote_addr - $remote_user - $status - "$request" - $bytes_sent - "$http_referer" - "$http_user_agent" - "$server_name" - $upstream_addr - $http_host - $upstream_response_time - $request_time';
4848

4949
# send logs to STDOUT so they can be seen using 'docker logs'
5050
access_log /opt/nginx/logs/access.log upstreaminfo;
@@ -181,6 +181,9 @@ http {
181181
access_log off;
182182
return 200;
183183
}
184+
location /router-nginx-status {
185+
stub_status on;
186+
}
184187
}
185188
}
186189

0 commit comments

Comments
 (0)