400 Bad Request: The plain HTTP request was sent to HTTPS port
Plain HTTP was sent to a port that expects TLS
Seen in nginx
nginx received an unencrypted HTTP request on a port configured with listen ... ssl.
Common causes
- A URL like http://example.com:443 that uses the HTTPS port without https://.
- A load balancer or proxy forwarding plain HTTP to the origin's port 443.
- A port listed with ssl in nginx that clients reach over plain HTTP.
How to fix it
- Use https:// for that port, or point HTTP traffic at port 80.
- Set the load balancer or CDN to connect to the origin over HTTPS, or to port 80 for HTTP.
- Redirect these requests in nginx: error_page 497 https://$host$request_uri;
Got a different message? Paste it into the error explainer.
Related errors
- 502 Bad Gateway · The proxy got a bad response from the server behind it
- 504 Gateway Timeout · The server behind the proxy took too long
- Error 520: Web server is returning an unknown error · Cloudflare got an empty or invalid response
- 429 Too Many Requests · You've hit a rate limit
- 400 Bad Request · The server could not understand the request
- 401 Unauthorized · The request needs valid credentials
- 403 Forbidden · The server refuses to allow this request
- 404 Not Found · Nothing exists at this URL
- 405 Method Not Allowed · This URL does not accept that HTTP method
- 410 Gone · The resource was removed on purpose
- 414 Request-URI Too Large · The URL is longer than the server accepts
- 500 Internal Server Error · The application hit an error it did not handle