HTTP CONNECT method with proxied dns

I created a CNAME record to point my http-proxy server.
Once using the ‘proxied’ option for that record, I noticed that my HTTP CONNECT requests are getting 400 from cloudflare. When NOT using the proxy option, all works as usual. This is the error I get:

< HTTP/1.1 400 Bad Request
< Server: cloudflare
< Date: Tue, 12 Mar 2024 15:25:47 GMT
< Content-Type: text/html
< Content-Length: 155
< Connection: close
< CF-RAY: -
< 
* CONNECT tunnel failed, response 400
* Closing connection 0```

Thanks in advance!

Hi @gilb,

A bad request is not routed through Cloudflare’s network.

For example you may send headers amounting to more than 32KB or use specific headers which are stripped by Cloudflare in turn breaking your own request, thus returning the 400.

Unfortunately without see/replicating the actual request it would be difficult to troubleshoot.

You may need to test your request incrementally to see what breaks.

Thank you.

Hi @oshariff,
Thanks for the quick reply.
Is it possible for me to check the Cloudflare console for any error logs to identify what went wrong? The request I submitted was very straightforward, as follows:

curl -x "https://<cname proxied record>" "https://example.com"  -v

If you are on Pro/Biz plan, you can check your Analytics tab. However, if you request more detailed logs, you can consider Cloudflare Logs which is available on Enterprise plan.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.