Open WebUI web search with SearXNG fails with 403
403 Client Error: ForbiddenShort answer
Open WebUI asks SearXNG for JSON results, and SearXNG refuses that unless json is listed in the formats in settings.yml. The log then shows 403 Client Error: Forbidden. Add json to the search formats, restart SearXNG, and use the container service name in the query URL, not localhost.
Fix it fast
1Find out which cause you have
Read the Open WebUI log at the moment you run a search. A 403 points to the SearXNG settings; a connection error points to the URL.
docker logs open-webui --tail 502Match what you see, then jump to its fix
What does the error look like?
403 Client Error: ForbiddenWeb search returns no results with SearXNG selected
Cause 1 of 2
json is missing from the SearXNG formats
1Check
Open the SearXNG settings.yml and look at the formats list under search.
grep -n -A4 '^search:' searxng/settings.yml2Fix
Add json to the formats list, then restart SearXNG. The Open WebUI guide says SearXNG blocks queries without it.
search:
formats:
- html
- json3Verify
Restart SearXNG, run a chat with web search on, and confirm the 403 line no longer appears.
docker compose restart searxng
docker logs open-webui --tail 30Confirmed by docs.openwebui.com
Cause 2 of 2
The query URL points at the wrong host
1Check
If both services run in the same Compose project, the URL must use the SearXNG service name. localhost inside the Open WebUI container is Open WebUI itself.
docker exec open-webui env | grep -i searxng2Fix
Set the query URL to the service name and the /search path, and select searxng as the engine.
environment:
ENABLE_WEB_SEARCH: "true"
WEB_SEARCH_ENGINE: "searxng"
SEARXNG_QUERY_URL: "http://searxng:8080/search"3Verify
Recreate the container and run a chat with web search switched on.
docker compose up -d open-webui && docker logs open-webui --tail 20Confirmed by docs.openwebui.com
How do I stop it coming back?
- Keep SearXNG settings.yml in a mounted file so your formats change survives container recreation.
- Put Open WebUI and SearXNG in one Compose project and address them by service name.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
AI
Chroma data is empty after a restart in LangChain
The collection is empty after the app restarts
Chroma only keeps data when you ask it to.
3 causes, each with a fixAI
The shell says ollama: command not found
command not found: ollama
The shell can only run ollama if the binary is installed in the same place the shell runs.
2 causes, each with a fixAI
Ollama is slow and the GPU is not being used
Replies arrive a few tokens per second on a machine with a GPU
Run ollama ps and read the PROCESSOR column: 100% GPU means the model is on the card, anything with CPU means it is not fully there.
4 causes, each with a fixAI
Open WebUI or another Docker app cannot connect to Ollama
Connect call failed ('127.0.0.1', 11434)
Inside a container, localhost is the container itself, not your machine, so a call to 127.0.0.1:11434 never reaches Ollama.
3 causes, each with a fixAI
pymilvus times out connecting to Milvus on localhost:19530 from a container
MilvusException: (code=2, message=Fail connecting to server on localhost:19530. Timeout)
Inside a container, localhost is the container itself, not the machine or the Milvus container, so the app gets a timeout on port 19530.
2 causes, each with a fixAI
Azure OpenAI says the API deployment for this resource does not exist
The API deployment for this resource does not exist
Azure OpenAI does not take a model name in the model field.
2 causes, each with a fix