Skip to content

[Feature]: Allow base-path URLs for docling-serve behind a reverse proxy #44

Description

@jimmerricks

What problem are you trying to solve?

When docling-serve is accessed via a reverse proxy — for example through llama-swap, which exposes it at a path like http://host:9292/upstream/docling-serve — the plugin rejects the Server URL with the error "Server URL must not include a path". This makes it impossible to use zotero-docling in any setup where docling-serve is not at the root of a host:port, which is common when running multiple services behind a single proxy.

Proposed solution (optional)

Remove the pathname check in testServerConnection and treat the configured URL as a base path, appending /health, /v1/convert/file, etc. relative to it. So http://host:9292/upstream/docling-serve/health rather than http://host:5001/health.

The conversion code already strips trailing slashes from the stored URL before appending API paths, so the main change needed is in testServerConnection. A one-line fix was prototyped with Claude's assistance and confirmed working: replacing the pathname rejection with const basePath = parsed.pathname.replace(/\/+$/, "") and fetching ${parsed.origin}${basePath}/health.

Alternatives considered

No response

How much would this affect your workflow?

Useful — would speed up something I do regularly

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions