Skip to content
MtrXTools

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

  1. Use https:// for that port, or point HTTP traffic at port 80.
  2. Set the load balancer or CDN to connect to the origin over HTTPS, or to port 80 for HTTP.
  3. Redirect these requests in nginx: error_page 497 https://$host$request_uri;
Check the redirect to HTTPS

Got a different message? Paste it into the error explainer.

Related errors

All 51 HTTP & CDN errors