Skip to content

refs platform/#2470: fix structured logging adding x forwarded for informations #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/conf.d/001-structured-logs.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
log_format structured '{"requestId": "$request_id", "status": $status, "request": "$request", "remoteAddr": "$remote_addr", "body_bytes_sent": $body_bytes_sent, "http_referer": "$http_referer", "http_user_agent": "$http_user_agent"}';
log_format structured '{"requestId": "$request_id", "status": $status, "request": "$request", "remoteAddr": "$remote_addr", "http_x_forwarded_for": "$http_x_forwarded_for", "proxy_add_x_forwarded_for": "$proxy_add_x_forwarded_for", "body_bytes_sent": $body_bytes_sent, "http_referer": "$http_referer", "http_user_agent": "$http_user_agent"}';
1 change: 1 addition & 0 deletions templates/fastcgi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fastcgi_param QUERY_STRING $query_string;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param X_FORWARDED_FOR $http_x_forwarded_for;
fastcgi_param ADD_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
fastcgi_param WEBSERVER_REQUEST_ID $request_id;

Expand Down