How to block requests that specify port numbers?

What’s a good Custom Rule for blocking requests that specify a port number (rather than assuming the protocol default)?

:white_check_mark:example .com
:x:example .com:1234
:white_check_mark:example .com/page
:x:example .com:5678/page

Cloudflare only supports a few alt. network ports than the normal ones, but if you want to just block all but the defaults on their edge, you can do so with a simple custom/firewall rule:
(Click “Edit Expression” and manually input this)

not cf.edge.server_port in {80 443}

Choose action: Block

It’s not a bad idea, you get a lot of junk traffic especially on Certificate Renews from CT Logs


Added to Custom Rules.


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