497 Error

A 497 HTTP Request Sent to HTTPS Port error is an nginx-specific code for:

“You sent an unencrypted plain HTTP request to an encrypted HTTPS port.”

A 497 HTTP Request Sent to HTTPS Port error is an internal status code used by nginx when a client sends an unencrypted plain HTTP request to a port configured for SSL/TLS encryption.

If an nginx server block is configured with listen 443 ssl; and a visitor types http://example.com:443 into their browser instead of https://example.com:443, nginx detects plain HTTP text on an encrypted port and returns code 497.

Determining why

Web browsers send unencrypted text when you type http://. When that unencrypted text hits a port expecting an encrypted TLS handshake, the protocols mismatch.

Steps you could possibly take:

  • Change the URL to HTTPS - Change http:// to https:// in your browser’s address bar.
  • If you are the server administrator:
    • Automatically redirect plain HTTP requests on SSL ports to HTTPS using nginx’s error_page directive:
      error_page 497 https://$host:$server_port$request_uri;

Source: nginx Documentation - ngx_http_ssl_module