From e950b90b9505e1160522813e138d3856a402e212 Mon Sep 17 00:00:00 2001 From: Michael Both Date: Tue, 30 Oct 2018 12:36:30 +0100 Subject: [PATCH] Extend log format --- jobs/nginx/templates/nginx.conf.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jobs/nginx/templates/nginx.conf.erb b/jobs/nginx/templates/nginx.conf.erb index 33f67a8..53a9249 100644 --- a/jobs/nginx/templates/nginx.conf.erb +++ b/jobs/nginx/templates/nginx.conf.erb @@ -4,7 +4,7 @@ # # This is optional and can be seen as a additional security feature. # If you have a sound network configuration that guarantees that only -# request from the loadbalancers network can reach the ssl-gateway, +# request from the loadbalancers network can reach the ssl-gateway, # you can leave it off. user vcap; worker_processes 12; @@ -26,17 +26,19 @@ http { <% if p('a9s_ssl_gateway.enable_proxy_protocol') %> log_format main '$proxy_protocol_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + '"$http_user_agent" "$http_x_forwarded_for" ' + '$connection $connection_requests $request_length $request_time'; <% else %> log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + '"$http_user_agent" "$http_x_forwarded_for" ' + '$connection $connection_requests $request_length $request_time'; <% end %> access_log /var/vcap/sys/log/nginx/access.log main; - + <% if p('a9s_ssl_gateway.enable_proxy_protocol') %> - <% p('a9s_ssl_gateway.load_balancer_address').each do |load_balancer| %> + <% p('a9s_ssl_gateway.load_balancer_address').each do |load_balancer| %> set_real_ip_from <%= load_balancer %>; <% end %> real_ip_header proxy_protocol;