Software⏱️ 2 min read📅 2026-06-03

How to Fix: Dealing with nginx 400 "The plain HTTP request was sent to HTTPS port" error

Configure Passenger to allow HTTP requests on HTTPS port.

Quick Answer: Add the following configuration to your server block: listen 80; and add a "location" block with a "proxy_pass`` directive that specifies the HTTP port.

To resolve the 'The plain HTTP request was sent to HTTPS port' error, you need to configure your nginx server block to respond to both HTTP and HTTPS requests.

⚠️ Common Causes

  • Ignoring the 'server' directive for HTTP requests.

🔧 Proven Troubleshooting Steps

Method 1: Enable HTTP Requests

  1. Step 1: Add the 'server' directive for HTTP requests in your nginx configuration.

Method 2: Configure SSL Caching

  1. Step 1: Add the 'ssl_cache' directive to your server block.

✨ Wrapping Up

By following these steps, you should be able to resolve the 'The plain HTTP request was sent to HTTPS port' error and ensure your nginx server block responds to both HTTP and HTTPS requests.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions