SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. NGINX
  3. 497 HTTP Request Sent to HTTPS Port

497 HTTP Request Sent to HTTPS Port

๐Ÿšช
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);
Related Status Codes
โฌ†๏ธ426Upgrade Required๐Ÿคจ400Bad Request

497 HTTP Request Sent to HTTPS Port FAQ

What causes a 497 HTTP Request Sent to HTTPS Port error?

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).

496 SSL Certificate Required498 Invalid Token

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes โ†’

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

ยฉ 2026 SiteError.com. All rights reserved.