Skip to content

Qdrant API ignores base URL path when server URL contains a subpath #1146

@vterrisse

Description

@vterrisse

Hi,

When configuring the Qdrant server URL without a path, everything works as expected:

  • https://my-qdrant
    → The Qdrant API functions correctly.

However, when the server URL includes a subpath:

  • https://my-qdrant/path1/path2
    → The Qdrant API ignores /path1/path2, and requests are sent as if the base path did not exist.

Root cause

This behavior seems to be caused by the use of a leading / in the url argument passed to urljoin.
A leading slash causes urljoin to override the base path entirely, instead of appending to it.

Example from qdrant_client/http/api/points_api.py:

return self.api_client.request(
    type_=m.InlineResponse20016,
    method="POST",
    url="/collections/{collection_name}/points/scroll",
    headers=headers if headers else None,
    path_params=path_params,
    params=query_params,
    content=body,
)

Because the url starts with /, any path defined in the base server URL (e.g. /path1/path2) is discarded.

Proposed change

Remove the leading slash so that the endpoint is correctly appended to the base URL:

return self.api_client.request(
    type_=m.InlineResponse20016,
    method="POST",
    url="collections/{collection_name}/points/scroll",
    headers=headers if headers else None,
    path_params=path_params,
    params=query_params,
    content=body,
)

This change would allow Qdrant to work correctly when deployed behind a reverse proxy or under a subpath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions