🚪
497
HTTP Request Sent to HTTPS Port

Example HTTP Response

HTTP Response
HTTP/1.1 497 HTTP Request Sent to HTTPS Port
Content-Type: text/html

<html><body>The plain HTTP request was sent to HTTPS port</body></html>
Common Causes
  • Client used http:// instead of https:// for an HTTPS-only server
  • Port configured with listen 443 ssl receiving plain HTTP
  • Misconfigured client or hardcoded HTTP URLs
  • Mixed content in web pages (HTTP resources on HTTPS page)
Technical Details

What does this mean?

Wrong entrance! You tried to walk through the secure door without the secret handshake. This is the HTTPS-only entrance — go use the secure protocol!

Technical Definition

The client sent a plain HTTP request to a port that nginx has configured for HTTPS only.

Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(497).json({
    error: 'HTTP Request Sent to HTTPS Port',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(497, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'HTTP Request Sent to HTTPS Port',
    message: 'Your error message here'
  }));
}).listen(3000);