Skip to content

Cloudflare Web3 Gateways: IPFS and Ethereum Access -- Complete Guide

DodaTech Updated 2026-06-23 6 min read

In this tutorial, you will learn how Cloudflare Web3 gateways work, how to serve IPFS content through your custom domain, and how to provide HTTP access to the Ethereum network using Cloudflare's distributed infrastructure.

Why Web3 Gateways Matter

Accessing decentralized networks like IPFS and Ethereum traditionally requires running specialized client software. IPFS content is addressed by content hash rather than location, meaning users need an IPFS node to retrieve files. Ethereum requires a full node or an RPC provider to interact with smart contracts and read Blockchain data. Cloudflare Web3 gateways bridge this gap by providing standard HTTP endpoints that serve content from IPFS and Ethereum through Cloudflare's global edge network. This means users can access https://ipfs.example.com/QmHash or https://<a href="/cryptocurrency/ethereum/">Ethereum</a>.example.com/ without installing any Web3 software, while you get Cloudflare's caching, DDoS protection, and performance optimization on top. Cloudflare provides these gateways as a managed service, eliminating the operational overhead of running your own gateway infrastructure. Combined with Cloudflare DNS and SSL/TLS configuration, Web3 gateways make decentralized content accessible to every browser user.

Real-world use: A DAO publishes its governance documents to IPFS and wants all members to access them without installing an IPFS client. By setting up a Cloudflare IPFS gateway at docs.dao.eth, members access documents via standard HTTPS URLs with Cloudflare's CDN providing fast global access.

Web3 Gateway Architecture

flowchart LR
    U[User Browser] --> D[Custom Domain]
    D --> C[Cloudflare Edge]
    C --> GIPFS[IPFS Gateway]
    C --> GETH[Ethereum Gateway]
    GIPFS --> IPFS[IPFS Network]
    GETH --> ETH[Ethereum Network]
    C --> Cache[Cloudflare Cache]
    Cache --> GIPFS
    style C fill:#f90,color:#fff
    style GIPFS fill:#f90,color:#fff
    style GETH fill:#f90,color:#fff

Setting Up an IPFS Gateway

Cloudflare's IPFS gateway allows you to serve IPFS content through a custom domain with automatic caching and SSL.

# Step 1: Create a gateway
# Cloudflare Dashboard > Web3 > Create Gateway
# Hostname: ipfs.yourdomain.com
# Type: IPFS
# DNS Link: Enabled

# Step 2: Configure DNS
# Cloudflare automatically adds a DNS record:
# Type: CNAME
# Name: ipfs
# Target: cloudflare-ipfs.com
# Proxy status: Proxied (orange cloud)
# Step 3: Serve IPFS content via your custom domain
# IPFS content is typically accessed via CID hash:
# https://ipfs.yourdomain.com/ipfs/QmT5NvUtoP5VwV5vYLeaKQqNqYFc7KqF

# With DNSLink, you can use human-readable paths:
# Set TXT record: _dnslink.ipfs TXT "dnslink=/ipfs/QmT5NvUtoP5VwV5vYLeaKQqNqYFc7KqF"
# Then access: https://ipfs.yourdomain.com/

Expected output: The IPFS gateway resolves the content identifier, fetches the content from the IPFS network, and serves it over HTTPS through Cloudflare's edge with full CDN Caching.

Setting Up an Ethereum Gateway

Cloudflare's Ethereum gateway provides HTTP access to the Ethereum Blockchain for reading data and interacting with smart contracts.

# Step 1: Create an Ethereum gateway
# Cloudflare Dashboard > Web3 > Create Gateway
# Hostname: eth.yourdomain.com
# Type: Ethereum

# Step 2: Configure DNS
# Cloudflare adds a CNAME record:
# Type: CNAME
# Name: eth
# Target: cloudflare-eth.com
# Proxy status: Proxied
# Step 3: Make JSON-RPC calls via your gateway
curl -X POST https://eth.yourdomain.com/mainnet \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'
# Expected output:
# {"jsonrpc":"2.0","id":1,"result":"0x10a4fb3"}

Smart Contract Interaction

You can read data from Ethereum smart contracts through the gateway using standard JSON-RPC calls.

# Read ERC-20 token balance for an address
curl -X POST https://eth.yourdomain.com/mainnet \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x70a08231000000000000000000000000<YOUR_ADDRESS>]
    }, "latest"],
    "id": 2
  }'
# Expected output:
# {"jsonrpc":"2.0","id":2,"result":"0x00000000000000000000000000000000000000000000..."}

Gateway Caching and Performance

Cloudflare caches IPFS content at the edge, reducing load on the IPFS network and improving access times for popular content.

# IPFS content is cached by CID:
# - First request: Gateway fetches from IPFS network
# - Subsequent requests: Served from Cloudflare edge cache
# - Cache invalidation: Via Cloudflare Cache > Purge

# Cache headers:
# - IPFS: Cache-Control based on content type
# - Ethereum: Responses are not cached (dynamic RPC data)

Common Errors

Error Cause Fix
Content not found IPFS CID does not exist Verify the CID is correct; ensure content is pinned to the IPFS network
DNSLink resolution failed TXT record missing or incorrect Check _dnslink.ipfs.yourdomain.com TXT record value
<a href="/cryptocurrency/ethereum/">Ethereum</a> RPC timeout Network congestion or invalid request Reduce request frequency; verify JSON-RPC payload is valid
CORS error Gateway CORS headers not configured for your domain Ensure the gateway hostname matches the requesting origin
Gateway not proxied DNS record set to DNS-only instead of proxied Change record to orange cloud (proxied) in Cloudflare DNS

Practice Questions

  1. What is the purpose of a Web3 gateway and how does it make decentralized content accessible?
  2. How does DNSLink allow human-readable paths for IPFS content?
  3. What JSON-RPC method would you use to read data from an Ethereum smart contract?

FAQ

Does Cloudflare cache IPFS content indefinitely?

Cloudflare caches IPFS content based on standard HTTP Caching rules. Content remains cached as long as it is requested regularly. If content is not accessed for extended periods, it may be evicted from the cache but remains available on the IPFS network. You can manually purge cached content from the Cloudflare dashboard.

Are there rate limits on the Ethereum gateway?

Yes. Cloudflare applies rate limits to Ethereum gateway requests to prevent abuse. The limits vary based on your plan level. Free plan gateways have lower limits than enterprise plans. For high-throughput Blockchain applications, consider using a dedicated RPC provider alongside the Cloudflare gateway for Load Balancing.

Can I use my own domain with the Web3 gateway?

Yes. You can use any custom domain that is active on Cloudflare. The gateway hostname must be a subdomain (e.g., ipfs.yourdomain.com or eth.yourdomain.com). Cloudflare automatically provisions SSL certificates for the gateway hostname and handles DNS configuration.

Summary

Cloudflare Web3 gateways provide HTTP access to IPFS and Ethereum networks through your custom domain with Cloudflare's CDN, Caching, DDoS protection, and SSL. IPFS gateways serve content-addressed files over HTTPS, while Ethereum gateways enable JSON-RPC calls to the Blockchain without running your own node.

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro -- security-first tools for the modern web.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro