企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
修改 `ingress-nginx-controller` 配置文件 ```shell $ kubectl -n ingress-nginx edit configmap ingress-nginx-controller # 在 data 字段添加下面内容 data: log-format-upstream: '{"time": "$time_iso8601", "namespace": "$namespace", "service_name": "$service_name", "service_port": $service_port, "domain": " $host", "path": "$uri", "request_id": "$req_id", "remote_user": "$remote_user", "request_query": "$args", "bytes_sent": $bytes_sent, "status": $status, "request_time": $request_time, "request_proto": "$server_protocol", "request_length": $request_length, "duration": $request_time, "method": "$request_method", "http_referrer": "$http_referer", "remote_addr":"$remote_addr", "remote_port": "$remote_port", "proxy_protocol_addr": "$proxy_protocol_addr", "proxy_add_x_forwarded_for": "$proxy_add_x_forwarded_for", "x_forwarded_for": "$http_x_forwarded_for", "http_user_agent": "$http_user_agent" }' ``` 重启 ingress-nginx-controller 容器 ```shell $ kubectl -n ingress-nginx delete pod -l app.kubernetes.io/component=controller pod "ingress-nginx-controller-6c979c5b47-n6stn" deleted pod "ingress-nginx-controller-6c979c5b47-5wixe" deleted ```