Skip to content

[Bug]: Custom Proxy Base Url not working #5997

Closed
@DanielOtter

Description

@DanielOtter

What happened?

I was trying to deploy litellm with custom proxy base url settings but get requests of /sso and /ui do not append the base url and call the wrong urls. Since I am using a url map in my setup to redirect requests with different base urls to their respective services, these requests go to the void.

I followed the docs and built my image with a slightly edited Dockerfile:

# Use the provided base image
FROM ghcr.io/berriai/litellm:litellm_fwd_server_root_path-dev

# Set the working directory to /app
WORKDIR /app

# Install Node.js and npm (adjust version as needed)
RUN apt-get update && apt-get install -y nodejs npm

# Copy the UI source into the container
COPY ./ui/litellm-dashboard /app/ui/litellm-dashboard

# Set an environment variable for UI_BASE_PATH
# This can be overridden at build time
# set UI_BASE_PATH to "<your server root path>/ui"
ENV UI_BASE_PATH="/litellm/ui"

# Build the UI with the specified UI_BASE_PATH
WORKDIR /app/ui/litellm-dashboard
RUN npm install
RUN UI_BASE_PATH=$UI_BASE_PATH npm run build

# Create the destination directory
RUN mkdir -p /app/litellm/proxy/_experimental/out

# Move the built files to the appropriate location
# Assuming the build output is in ./out directory
RUN rm -rf /app/litellm/proxy/_experimental/out/* && \
    mv ./out/* /app/litellm/proxy/_experimental/out/

# Switch back to the main app directory
WORKDIR /app
RUN pip install prisma 
RUN prisma generate

RUN chmod +x entrypoint.sh

COPY config.yaml config.yaml

EXPOSE 8080/tcp

ENTRYPOINT ["litellm"]
CMD ["--port", "8080", "--config", "config.yaml"]

The environment variable of the running container is set to:
SERVER_ROOT_PATH="/litellm"

Relevant log output

[01/Oct/2024:13:18:29 +0000] "GET /ui/favicon.ico HTTP/1.1" 200 944 "https://placeholderdomain.com/litellm/ui/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions