mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-09 10:50:35 -06:00
[GH-ISSUE #18509] issue: Custom headers not passed correctly when using Kong Key Authentication #73221
Reference in New Issue
Block a user
Originally created by @Stanleyluuuu on GitHub (Oct 22, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18509
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.34
Ollama Version (if applicable)
No response
Operating System
Rocky 9.6
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When a custom header is defined in Open WebUI (e.g. X-API-Key: ),
the header should be included in the outgoing request to the configured API (e.g. /v1/models).
Kong should validate the key and return a successful 200 response.
Actual Behavior
Even after setting the custom header in Open WebUI v0.6.33,
requests to the API (e.g. /v1/models) return 401 Unauthorized from Kong.
Logs on the Kong side show that the expected authentication header is missing,
meaning the key–value pair wasn’t sent in the request.
Steps to Reproduce
Logs & Screenshots
Additional Information
Hi, I encountered an issue when using custom headers together with Kong Key Authentication.
I usually deploy my OpenAI-format LLM API behind Kong, and require users to include a custom key–value pair in the request headers for authentication.
This allows us to track usage and control traffic per user.
Recently, I noticed that Open WebUI v0.6.33 introduced a feature to add custom headers when configuring OpenAI-compatible APIs.
I was hoping this would solve my previous issue — that Open WebUI couldn’t include my custom Kong key in the headers.
However, after testing, I still receive a 401 Unauthorized from Kong.
It seems the custom key–value pair is not actually being sent in the request headers, because the request to /v1/models fails authentication on Kong’s side.
I reviewed the code here
, and it looks like custom headers should indeed be merged into the request before calling /v1/models.
So I’m wondering — is there something preventing these custom headers from being applied in practice?
🧠 Summary
Kong behind Open WebUI uses Key Authentication
Added custom header in Open WebUI (v0.6.33)
Request to /v1/models still returns 401 Unauthorized
Expected: the custom key header should be included and authenticated correctly
💬 Question
Is there a known limitation or middleware stripping out custom headers before the request is sent?
Or is there a specific configuration required for the custom headers to take effect?