Comment 1 for bug 2022065

Revision history for this message
Nobuto Murata (nobuto) wrote :

We should additionally set either "rgw remote addr param" or "rgw log http headers" with "HTTP_X_FORWARDED_FOR" otherwise the remote ip is always 127.0.0.1.

$ juju config ceph-radosgw \
    config-flags='{"global":{"rgw enable ops log": true, "rgw remote addr param": "HTTP_X_FORWARDED_FOR"}}'

        {
            "bucket": "simplestreams",
            "time": "2023-06-01T13:10:00.060561Z",
            "time_local": "2023-06-01T13:10:00.060561+0000",
            "remote_addr": "192.168.151.107",
            "object_owner": "1515718f5892428fa97d4641243848ed",
            "user": "anonymous",
            "operation": "get_obj",
            "uri": "GET /simplestreams/foo HTTP/1.1",
            "http_status": "200",
            "error_code": "",
            "bytes_sent": 0,
            "bytes_received": 0,
            "object_size": 0,
            "total_time": 4,
            "user_agent": "curl/7.81.0",
            "referrer": "",
            "trans_id": "tx00000ff5efd6ded2863e0-00647898a8-9207-default",
            "authentication_type": "Local",
            "temp_url": false
        },

$ juju config ceph-radosgw \
    config-flags='{"global":{"rgw enable ops log": true, "rgw log http headers": "http_x_forwarded_for"}}'

        {
            "bucket": "simplestreams",
            "time": "2023-06-01T12:44:27.316514Z",
            "time_local": "2023-06-01T12:44:27.316514+0000",
            "remote_addr": "127.0.0.1",
            "object_owner": "1515718f5892428fa97d4641243848ed",
            "user": "anonymous",
            "operation": "get_obj",
            "uri": "GET /simplestreams/foo HTTP/1.1",
            "http_status": "200",
            "error_code": "",
            "bytes_sent": 0,
            "bytes_received": 0,
            "object_size": 0,
            "total_time": 8,
            "user_agent": "curl/7.81.0",
            "referrer": "",
            "http_x_headers": [
                {
                    "HTTP_X_FORWARDED_FOR": "192.168.151.107"
                }
            ],
            "trans_id": "tx000002dcd7463dff3832f-00647892ab-8c1f-default",
            "authentication_type": "Local",
            "temp_url": false
        }