How to Fix 505 HTTP Version Not Supported
Check the HTTP version your client sent, resend as HTTP/1.1, and trace any hop that rewrote your request.
Updated
TL;DR
505 HTTP Version Not Supported means a website's server, or a proxy or load balancer in front of it, refuses the HTTP version your request named. The fastest fix is to stop forcing a version: send plain HTTP/1.1, or let your HTTP client negotiate it.
What a 505 looks like in servers and clients
Servers word the refusal in their own way; most clients print only the number.
| Where | What you see |
|---|---|
| Go net/http server, status line | HTTP/1.1 505 HTTP Version Not Supported: unsupported protocol version |
| nginx default error page, heading | 505 HTTP Version Not Supported |
| Chrome, when the 505 has an empty body | HTTP ERROR 505 |
| curl --fail | curl: (22) The requested URL returned error: 505 |
| Python urllib.request | urllib.error.HTTPError: HTTP Error 505: HTTP Version Not Supported |
| Python requests (raise_for_status) | requests.exceptions.HTTPError: 505 Server Error: HTTP Version Not Supported for url: https://shop.example.com/cart |
| Java HttpURLConnection | java.io.IOException: Server returned HTTP response code: 505 for URL: https://shop.example.com/cart |
Why this happens
The opening line of what you sent claims a protocol version the server won't speak.
Requests built by hand or with a forced version flag do this. HTTP/2 is agreed in the TLS handshake and sent as binary frames, so text claiming HTTP/2.0 got 505 from Go's server in our test.
Diagnose your 505 first
The first check needs only a browser; the rest show what was sent and who refused it.
Open the address in a second browser or on another device on the same Wi-Fi; if 505 appears there too, your browser isn't the cause.
Run curl -v on the URL; if the first > line ends in HTTP/1.1 yet 505 returns, the cause lies beyond your client.
Repeat with curl --http1.1 and a percent-encoded URL; if that succeeds where your own code gets 505, your code builds the request wrongly.
Read the 505's body; 'unsupported protocol version' is Go's server, and a page with an nginx footer was written by nginx itself.
Site owners: set nginx's error_log to info; 'client sent invalid version' means nginx refused a major version above 1.
Solutions ranked by effectiveness
The first two fix your own request; the third is for site owners.
- Most common fix
Send the request as HTTP/1.1
Applies when your code or tool names the version itself, such as a hand-written HTTP/2.0 line or a flag that skips negotiation. Send plain HTTP/1.1, then read the version, status and body returned.
import http.client, urllib.parse path = urllib.parse.quote("/files/annual report.pdf") conn = http.client.HTTPSConnection("example.com", timeout=30) conn.request("GET", path) res = conn.getresponse() print("got:", f"HTTP/{res.version / 10}", res.status, res.reason) print(res.read(300).decode(errors="replace")) conn.close() - Check next
Repair the request line
Applies when your code or device writes the request text itself, or only addresses with spaces fail. Older servers, such as Tomcat 7.0.70, read the word after a raw space as the version.
Replace each space in the path or query with %20 before sending.
End the first line with HTTP/1.1 and \r\n, not a bare \n.
Trim line breaks from any value you paste into the URL.
Prefer an HTTP library: curl, Python's urllib and Node.js reject or encode raw spaces.
- Site owners
Fix the hop that changes requests
Applies when clients send valid HTTP/1.1 and still get 505. Look for a reverse proxy or load balancer that forwards a decoded URL, or a version its backend refuses.
In nginx, write proxy_pass without a URI or with $request_uri, never the decoded $uri.
On an AWS ALB, point HTTP/2 clients at an HTTPS listener.
Check its access log: a 505 with target_status_code - came from the balancer itself.
Then request an address containing %20 through the proxy and expect 200.
Stop the 505 from coming back
Habits for whoever runs the servers, so the next refused request is easy to trace.
Write a 505 body that names the versions you accept; RFC 9110 recommends it.
Keep $request in nginx's log_format; it records the full request line, version included, beside each 505.
After adding a proxy, log the version your app receives; nginx before 1.29.7 sent HTTP/1.0 upstream by default.
Answer a malformed request line with 400 or a 301 to the encoded address, as RFC 9112 advises.
Related errors
Learn more
FAQ
Proxy endpoints for your tools
Create HTTP, HTTPS or SOCKS5 endpoints in the dashboard for browsers, scrapers or scripts.


