datatracker/k8s/nginx-logging.conf
Jennifer Richards 247361b7dd
ci: better access logs+redirect auth URLs+fix X-Request-Start header (#7700)
* fix: silence nginx healthcheck logs

* fix: nginx logs in JSON

* fix: typos in nginx conf

* refactor: repeat less nginx config

* fix: log more req headers from gunicorn

* fix: redirect auth->datatracker, not deny

* feat: log X-Forwarded-Proto
2024-07-30 20:55:07 -03:00

21 lines
902 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_ms":"$${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"'
'}';