Skip to content

[Bug]: Custom root path (still) does not work #11451

@ak11234

Description

@ak11234

What happened?

Based on #10761, we would expect for the custom root path (as referred to in docs to work. Meaning we set SERVER_ROOT_PATH as an environment variable when starting the litellm proxy.

However, it does not. For example, in setting SERVER_ROOT_PATH=/proxy, we see the following:

  • Upon visiting the Swagger UI, the main html loads, and attempts to load its dependent scripts from the bare URL, not using the custom path.
  • Upon visiting the management UI, the main HTML loads, but again the dependent scripts attempt to load from the bare URL, not using the custom path.
    • This problem may not be immediately obvious if you are directly accessing the container without a proxy in front that will ONLY allow traffic with the custom base path. If litellm receives the request for the js/css at the non-custom base path, it will redirect those requests to the correct custom path, so it appears to work in bench testing.

If we add in the old setting PROXY_BASE_URL that is no longer listed on that docs page:

  • The Swagger UI now loads correctly
  • The management UI's html still refers to the wrong paths
  • The /litellm/.well-known/litellm-ui-config API does show the correct base urls

I have tried a number of versions, up to and including the official docker images from v1.72.1-nightly to no avail.

I see that @krrishdholakia closed the bug report as completed/fixed back in v1.71.2, but I am curious to here if they actually tested to make sure it worked...

Relevant log output

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.72.1-nightly

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions