HTTP 101 Switching Protocols — What It Means

What HTTP status code 101 Switching Protocols means, when servers return it, and how to handle it correctly.

Published September 22, 2026

HTTP 101 Switching Protocols means the server agrees to the client's request to change the protocol on the same connection, most commonly upgrading HTTP to WebSocket.

What it means

The client sends Upgrade and Connection headers; the server answers 101 and from then on both sides speak the new protocol over the same TCP connection.

Common causes: WebSocket handshake; HTTP/2 cleartext upgrade (h2c); Protocol upgrade requests.

On the wire

GET /chat HTTP/1.1
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZQ==
A typical 101 exchange.

Practical examples

Test it from the shell

curl -i https://example.com/path   # look for HTTP 101

Handling 101 in code or config

location /ws { proxy_pass http://app; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }

How to fix it

Forward Upgrade and Connection headers in your reverse proxy; Check the proxy_read_timeout for long-lived sockets; Verify the server supports the requested protocol.

1. Reproduce: curl -i <url>
2. Confirm the status is 101
3. Apply the fix above and re-test

Common mistakes

  • Treating this as an error when it is a normal part of HTTP.
  • Check the proxy_read_timeout for long-lived sockets
  • Ignoring the response headers that explain the details.

Key takeaways

  • 101 means Switching Protocols.
  • HTTP 101 Switching Protocols means the server agrees to the client's request to change the protocol on the same connection, most commonly upgrading HTTP to WebSocket.
  • Read the response headers and logs for the exact cause.

FAQ

Why does my WebSocket fail behind Nginx?

Nginx must be told to pass Upgrade and Connection headers and use HTTP/1.1 to the upstream.

Is 101 a client or server error?

It is a success status code, in the 1xx class.

More HTTP articles