Created At: 2026-11-20T01:48:43Z Completed At: 2026-11-20T01:48:48Z The search for ""Client sent an HTTP request to an HTTPS server" Cloudflare" returned the following summary: The error message **"Client sent an HTTP request to an HTTPS server"** (often seen in server logs like Nginx, Caddy, or Tomcat[1][2]) means that a client (or a proxy like Cloudflare) tried to communicate with your origin web server using unencrypted **HTTP (`http://`)**, but the server was expecting an encrypted **HTTPS (`https://`)** connection on that specific port[1][3]. When using Cloudflare, this error typically occurs due to a mismatch between **Cloudflare’s SSL/TLS encryption mode** and **how your origin server is configured**. --- ### Why this happens with Cloudflare 1. **Cloudflare connects via HTTP, but your server only accepts HTTPS:** If your Cloudflare SSL/TLS encryption mode is set to **Flexible**, Cloudflare communicates with your origin server over plain **HTTP (`http://your-server-ip`)**. However, if your origin server has been forced to *only* accept secure HTTPS connections (or has an Nginx/Apache block saying "The plain HTTP request was sent to HTTPS port"), the server will reject Cloudflare's request and throw this error[1]. 2. **Cloudflare connects via HTTPS, but the port is wrong:** If your Cloudflare SSL mode is set to **Full** or **Full (Strict)**, Cloudflare attempts to connect to your origin via HTTPS. If it hits a port on your server that is only bound to HTTP (or is misconfigured), you will get a protocol mismatch. --- ### How to Fix It Depending on your server setup, you have two primary ways to resolve this: #### Option A: Align your Cloudflare SSL setting with your Origin Server (Recommended) If your origin server **has an active SSL/TLS certificate installed** (even if it's self-signed): 1. Log in to the **Cloudflare Dashboard**[4]. 2. Go to the **SSL/TLS** app[4][5]. 3. Change your encryption mode from *Flexible* to **Full** or **Full (Strict)**[6][5]. * *Full* allows Cloudflare to connect to your origin via HTTPS without strictly validating the origin certificate[7]. * *Full (Strict)* requires a valid, trusted SSL certificate on your origin[6][8]. 4. This ensures Cloudflare talks to your server using HTTPS (`https://`), matching what your server expects. If your origin server **does NOT have an SSL certificate**: * You must keep Cloudflare set to **Flexible**[7]. * However, you will need to fix your origin web server configuration (Option B) so that it actually listens for plain HTTP traffic from Cloudflare on the designated port (usually port 80 or your unencrypted backend port), rather than forcing redirect loops or throwing plaintext-to-SSL errors. #### Option B: Fix your Origin Server Configuration (Nginx / Apache / Caddy) If you are seeing this inside your Nginx or reverse proxy logs, it usually means your server block is listening on an SSL port (like 443) or expects TLS, but received a plain HTTP payload[1]. * **For Nginx:** Check your `nginx.conf` or site configuration file. Ensure you aren't mixing up `listen 443 ssl;` with plain HTTP requests. If Cloudflare is proxying to Nginx over HTTP, Nginx needs a server block listening on port 80 (or your cleartext port) without the `ssl` parameter. * **For Docker/Containers/Reverse Proxies:** Ensure that internal port mappings match. If a containerized service expects HTTPS internally, you must pass traffic to its secure port, or configure the container to accept HTTP plaintext inside a trusted local network. Sources: [1] [cloudflare.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQHquTnrI_Cb53HEHiy2Otv85UUfRhvyyCzClTmu84OV8SDfJucf0TTWFYIUSMdfy01BqM1VbjcIA-C5Mb946_8Br-2j5bOvlxFGgwAskNEotKTvCAyjqrPmZuq3-twDM_rvNcmsgQ62X49Iyvrga15tD6HZawhHdGb2S3tRwJzSBE01HZD-hh1thvvIJU4JO60YeY4eYzY_85hZV1s=) [2] [caddy.community](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQFkTyIiTEptRL2N5wyZjrMD5HpN6VuAh9Lefrjuo4g5cyugQVXrvG2X8S345POc9p8bmIZroU69yc43Or6p00qUStoWTM1d3L-0Weo4u_Li4oVEdMgmnMr52BcG9ocbe3MDHmgO0FiVbxPbhl-TNJkWoFQYazGIsqmhs_CVwSAShKqciA==) [3] [portainer.io](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQFUcsuEiZX75vzvAxVHAC9nyQNzm5kIA_KwGQJBqTSJ7yT12y0bnCzjAeQWgMvRBQdtVBxXgcRDNtZlx9_fvSjGA0kj-D-upLrLZbZBqEKPhPA063Ar8Lj9__qME4c-pDuBOXT9SeTdkTvTE-qiAZDreDxX3KTrE5jsebPNHG2Rp8sKbzVxkndLpHaoO9ZbOfIiEh5Yl0UMpd_yG-NhlvogXZg2neH1kIrFanEq) [4] [cloudflare.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQG0whoG4vPmw7uD7BLad3RRzOkcqIp1m4DOoz11MQTiiouKVAPj-c4t37ipoPsIMhksxt6Glv2Cbl7itHJPO5zvQj0Ya2W1eL2ZsdXXZGGzyrZZQYr8-U9qCOtm1iFH3Jyhe9waZC-M_zy1yDwIx-608Q9KCR0dBc8AH6Ui8tOp9y1W-n2nQwIMzuX_yi69yWTk) [5] [cloudflare.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQG7-UD1LWJvWoYYJBjxoSrGokNjN3Cs8yDIeePanW_1EW3qmloV5NEQrLMt7X1el1UwDnff2b0gOuDQXQNkmQKt0MqEcbgtyzAqpgfyOzliv14mFL5oqSloq22l6L-nLG1rZ0o3Se5mG9TFpIJbQNra-IbQAJUkhrHwT7umfwVhjMs5fwmBxX3nN7RVuToADbs3rY9cDBx6GRmV) [6] [cloudflare.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQE6Crlqn95Wg6ydpp65Vm1htaVn6eB0zmgx2lUkndx2iR6J72BpCtoT0qLeD12204jzLsmU5K7usErKqOvstQPzg-rj-gEg3wqkxqgOF4JCdV4vzCd1Rz3ar-3WVPIAk7KC-mR28muCt32ey8HEoDav3vHB2VpvSLSm6ESxv3kDY2rQmoXPRvZeQg==) [7] [youtube.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQHzEGN4JmLYhlGMS8OA8Hixaz1yAv9PSXpClq5Nzon8U5_cBXnO334UT6bcRmXGwGsvUzqzLd7hqv3520Uqjx337koroANlxUzXWS74K5pN_tqQ_AQVe3tpLNQ4TtqduCg=) [8] [finalsitesupport.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQGw6CBqHzWTaiugFqDkwbavjbRP-0ntT9wrzoaSd4UtDB0dwtj1AJvEdgiE_nzjT4fj4ysh37P3qgLlm2UGhUptGzE7ujyoT4tkAKuzxB0saGr4T1EdDXMhBRDzQXMXIPbGckSXEJjkZbIzBsN4piaEc2SPit9drUQTx0X8sc18vpGG-GW4ogNGJ0SBOUjTw9PzdQ8cQ3Z-0OlU7ksCNMs_P9weEGBlPm0qHTxCT2FAeLpXgR50pR1x) Note: Source URLs are HTTP redirects; check where they resolve if you need the direct link.