Add a blog to Cloudflare at /blog
The short answer
If your domain already runs through Cloudflare, a Worker on the /blog route serves the blog from Ranken and leaves every other request to your site. It works whatever builds the site behind it, and it runs at Cloudflare's edge, close to your visitors.
- Method
- A Cloudflare Worker on the /blog route
- Time
- About 3 minutes
- You need
- Your domain's DNS on Cloudflare, proxied
- Ranken plan
- Starter or Pro
How do I add a blog to Cloudflare?
Create your blog in Ranken and choose a /blog subfolder, then follow these steps. The examples use www.yoursite.com/blog. Your dashboard shows the same steps with your own address filled in, plus a prompt you can paste into an AI coding assistant.
- 1
Open Cloudflare
The DNS record for www.yoursite.com must be proxied (orange cloud).
- 2
Create a Cloudflare Worker
Workers & Pages, then Create, then Hello World. Replace the code with this and deploy.
worker.js // Ranken blog: /blog/* is served from Ranken. const BLOG_PATH = "/blog"; const ORIGIN = "https://proxy.ranken.blog/your-blog"; export default { async fetch(request) { const url = new URL(request.url); const rest = url.pathname.slice(BLOG_PATH.length); if (rest && !rest.startsWith("/")) return fetch(request); // another page, e.g. /blog-old const upstream = new Request(ORIGIN + rest + url.search, request); // Pages are cached at Cloudflare's edge for as long as Ranken's Cache-Control // allows; page-data requests (RSC header) are never cached here. const cacheable = request.method === "GET" && !request.headers.has("RSC"); return fetch(upstream, cacheable ? { cf: { cacheEverything: true } } : undefined); }, }; - 3
Add the route
In the Worker, open Settings, then Domains & Routes, and add the route www.yoursite.com/blog*
Runs at Cloudflare's edge, right next to your visitors.
What should you check before you start?
- If a Worker already serves this domain, add the blog branch to it instead of creating a second one.
- Check that no other route already matches www.yoursite.com/blog*.
Why put your Cloudflare blog at /blog instead of a subdomain?
A subfolder keeps every article on your main domain, so the links and authority each post earns build up in one place, next to your product or store pages. A subdomain such as blog.yoursite.com works too, but search engines can treat it more like a separate site. Ranken supports both, plus a custom domain.
Cloudflare blog questions
Is the Cloudflare Worker a reverse proxy?
Yes. The Worker is a small reverse proxy for /blog, and it lets Cloudflare cache pages for as long as Ranken's Cache-Control allows, and skips page-data requests so moving between articles stays fresh.
Does it work if my site runs on WordPress or Shopify?
Yes. The Worker sits in front of any site. On WordPress it is faster than the PHP plugin, and on Shopify, Webflow, Framer and Wix it is the way to add /blog.
Add a blog to another platform
Steps checked . See all integrations
Your Cloudflare site, now with a blog that ranks
Ranken hosts the blog at /blog with SEO, schema, llms.txt and one-click indexing built into every post.