Skip to content

Instantly share code, notes, and snippets.

@kyxap1
Created February 26, 2021 19:45
Show Gist options
  • Save kyxap1/6ef819e7116a43c4a869a922a8e36079 to your computer and use it in GitHub Desktop.
Save kyxap1/6ef819e7116a43c4a869a922a8e36079 to your computer and use it in GitHub Desktop.
```nginx
http {
...
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$http_x_fasten_backend" "$ssl_client_s_dn"';
log_format upstream_log '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"'
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
...
upstream consul { server 127.0.0.1:8500; }
server {
...
underscores_in_headers on;
log_not_found on;
access_log /var/log/nginx/access.log main;
...
location @consul {
access_log /var/log/nginx/consul.log upstream_log;
proxy_pass http://consul;
...
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment