Proxy only IPv4 not IPv6

I have an IPv6 origin server and would like to proxy IPv4 visitors through Cloudflare, but keep IPv6 unproxied. Is this possible? This seems like a very common setup but I can’t seem to find how it’s done.

You’d need different hostnames. When proxied Cloudflare returns IPv4 and IPv6 records for oof the Cloudflare edge for the origin.

1 Like

Hmm that’s unfortunate - different hostnames is not really a workable solution - it impossible for random visitors to know that they should visit ipv4.domain.com instead of domain.com. Besides, if I proxy ipv4.domain.com through cloudflare, it still proxies IPv6 visitors to that domain.

What is the best way to request this feature? I presume this is now a really common scenario for server owners these days: they can handle IPv6 traffic themselves, but need a proxy for legacy visitors.

I give Cloudflare IPv6 addresses only for web traffic, but certainly want both proxied. Not proxying IPv6 requests when IPv4 ones are seems a rare use case.

Anyway, I’ve tried this and seems to work. www to be proxied and ipv6.example.com to be “DNS only”.

Set a redirect rule…
(http.host eq "www.example.com" and ip.src in {2000::/3})
to redirect to ipv6.example.com (use a dynamic redirect to pass path and query parameters).

3 Likes

I think found the opposite (i.e. redirect IPv4, not IPv6) is probably easier?

  1. www.example.com (unproxied AAAA record)
  2. redirect rule (ip.src in {0.0.0.0/0}), redirects to legacy.example.com (proxied AAAA record)