[GH-ISSUE #7772] Curl Error: Trying curl request in CLI, but the response is a html #30725

Closed
opened 2026-04-22 10:37:27 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @bohaocheung on GitHub (Nov 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7772

  • in CLI
  • Input
curl http://localhost:11434/api/generate -d '{
  "model": "llama3.2",
  "prompt":"Why is the sky blue?"
}'
  • output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>500 Unable to connect</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>

<h1>Unable to connect</h1>

<p>Tinyproxy was unable to connect to the remote web server.</p>

<hr />

<p><em>Generated by <a href="https://tinyproxy.github.io/">tinyproxy</a> version 1.10.0.</em></p>

</body>

</html>

I've searched many ways to fix it but failed, please help me, thanks!!

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.4.2

Originally created by @bohaocheung on GitHub (Nov 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7772 - in CLI - Input ``` curl http://localhost:11434/api/generate -d '{ "model": "llama3.2", "prompt":"Why is the sky blue?" }' ``` - output ```html <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>500 Unable to connect</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Unable to connect</h1> <p>Tinyproxy was unable to connect to the remote web server.</p> <hr /> <p><em>Generated by <a href="https://tinyproxy.github.io/">tinyproxy</a> version 1.10.0.</em></p> </body> </html> ``` I've searched many ways to fix it but failed, please help me, thanks!! ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.4.2
GiteaMirror added the bug label 2026-04-22 10:37:27 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 21, 2024):

You have an HTTP proxy.

curl --noproxy '*' http://localhost:11434/api/generate -d '{
  "model": "llama3.2",
  "prompt":"Why is the sky blue?"
}'

or

export NO_PROXY=127.0.0.1,localhost

or

unset HTTP_PROXY
unset http_proxy
<!-- gh-comment-id:2490394667 --> @rick-github commented on GitHub (Nov 21, 2024): You have an HTTP proxy. ``` curl --noproxy '*' http://localhost:11434/api/generate -d '{ "model": "llama3.2", "prompt":"Why is the sky blue?" }' ``` or ``` export NO_PROXY=127.0.0.1,localhost ``` or ``` unset HTTP_PROXY unset http_proxy ```
Author
Owner

@bohaocheung commented on GitHub (Nov 21, 2024):

@rick-github Thanks for your reply! It really works!!! 😄 😄 😄

<!-- gh-comment-id:2490583038 --> @bohaocheung commented on GitHub (Nov 21, 2024): @rick-github Thanks for your reply! It really works!!! 😄 😄 😄
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#30725