Skip to content

Commit

Permalink
Extend log format
Browse files Browse the repository at this point in the history
  • Loading branch information
ionphractal authored and Michael Both committed Oct 30, 2018
1 parent 8e21e40 commit e950b90
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jobs/nginx/templates/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e950b90

Please sign in to comment.