AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
4xx Client Error
The 426 (Upgrade Required) status code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The response must include an Upgrade header indicating the required protocol.
When a client sends a request over HTTP to an endpoint that requires HTTPS, respond with 426 Upgrade Required and include Upgrade: TLS/1.2 in the header. The client should re-send the request over HTTPS. This is more informative than a generic redirect.
# Nginx - returning 426 for non-TLS requests
server {
listen 80;
server_name api.example.com;
return 426 "Upgrade Required";
add_header Upgrade TLS/1.2;
add_header Connection Upgrade;
}
Mistake: Forgetting the Upgrade header in a 426 response
Fix: A 426 response must include an Upgrade header specifying the required protocol. Without it, the client does not know what protocol to upgrade to.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026