Inconsistent results for 'Always Use HTTPS'

I have the Always Use HTTPS set to redirect all requests with scheme “http” to “https”. My site operates on non-standard port 2053 because my ISP blocks all known ports. 2053 is listed as accepted for HTTPS traffic in Cloudflare, nevetheless, I’m not sure if all Always use HTTPS will work on this port. Most times I get ‘400 Bad Request’ errors, and few times it seems that the redirection works only if I’m targeting the root ‘/’ and not any other resource. Any help would be greatly appreciated.

May I ask if 2053 port is open at your host/origin and if your application actually is listening on 2053 HTTPS port?

Do you use Nginx? And is the full error like The plain HTTP request was sent to HTTPS port?

True, it is listed as compatible for HTTPS.

Seems to me it could me some routing misconfiguration of your web server for your domain, maybe?

May I ask what have you got selected under the SSL tab/settings page at Cloudflare dashboard?

  • Is it Full SSL, Flexble SSL …?

That’s a good question. The documentation isn’t very specific on how it handles ports, but I’m quite sure that if anything gets redirected to HTTPS, it will end up on Port 443. And it might even ignore anything not going to Port 80. So for non-standard ports, I bet this isn’t a viable option.

I’d love to know if @cloonan could shed some light on this.

2 Likes

Port 2053 is a HTTPS port, and will always expecting HTTPS traffic coming in. If someone is sending HTTP request to port 2053 then Cloudflare will reject the request.

Similar to someone sending HTTP request to port 443, server will reject the HTTP request too because port 443 is not intended to process HTTP traffic - same goes to port 2053.

Always use HTTPS will not apply to non-standard ports in this case.

2 Likes

Thank you for the clear answer.

1 Like

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