497 HTTP Request Sent to HTTPS Port

Internal nginx code for a plaintext HTTP request that arrived on a port configured for TLS.

Status

HTTP/1.1 497 HTTP Request Sent to HTTPS Port

Details

When a plaintext request lands on a listener with ssl enabled, nginx cannot complete a handshake and logs 497. Configurations often map it to a redirect so users end up on the HTTPS URL rather than seeing a raw error.

In client tooling the same mistake usually surfaces as a TLS or protocol error rather than as a status code.

Common causes

How to fix it

As the client

As the server

Examples

(nginx access log)
497 "GET http://api.example.com:443/ HTTP/1.1" plain HTTP request sent to HTTPS port

Notes for proxy users

Sending a plaintext request to a proxy endpoint that expects TLS, or the reverse, produces the same class of confusion. Confirm the scheme and port for the proxy endpoint before debugging credentials.

See also