datatracker/k8s/nginx-logging.conf
Jennifer Richards b6f8ede98a
feat: is_authenticated request logging + cleanup (#7893)
* chore: nginx log is s, not ms

* chore: log seconds from gunicorn too

* chore: drop X-Real-IP header / log

* style: Black

* style: single -> double quotes

* feat: add is-authenticated header

* feat: log is-authenticated header

* chore: update nginx-auth.conf to match
2024-09-03 17:24:26 -05:00

21 lines
901 B
Plaintext

# Define JSON log format - must be loaded before config that references it
log_format ietfjson escape=json
'{'
'"time":"$${keepempty}time_iso8601",'
'"remote_ip":"$${keepempty}remote_addr",'
'"request":"$${keepempty}request",'
'"host":"$${keepempty}host",'
'"path":"$${keepempty}request_uri",'
'"method":"$${keepempty}request_method",'
'"status":"$${keepempty}status",'
'"len_bytes":"$${keepempty}body_bytes_sent",'
'"duration_s":"$${keepempty}request_time",'
'"referer":"$${keepempty}http_referer",'
'"user_agent":"$${keepempty}http_user_agent",'
'"x_forwarded_for":"$${keepempty}http_x_forwarded_for",'
'"x_forwarded_proto":"$${keepempty}http_x_forwarded_proto",'
'"cf_connecting_ip":"$${keepempty}http_cf_connecting_ip",'
'"cf_connecting_ipv6":"$${keepempty}http_cf_connecting_ipv6",'
'"cf_ray":"$${keepempty}http_cf_ray"'
'}';