What it means
The server agrees to the client's Upgrade request and switches the connection to another protocol, named in the Upgrade header. After this response, the connection no longer speaks HTTP/1.1.
Its main use today is opening WebSocket connections. HTTP/2 and HTTP/3 don't use 101; WebSockets there use extended CONNECT instead.
Why you're seeing it
- A WebSocket handshake succeeding (
Upgrade: websocket). - A client asking for cleartext HTTP/2 with
Upgrade: h2c, which is now deprecated.
How to fix it
- Nothing to fix. If a WebSocket fails, check that every proxy in front of the server forwards the
UpgradeandConnectionheaders. - In nginx, set
proxy_http_version 1.1and pass both headers explicitly.
Example response
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=