This is Article 2 in my Reverse Proxy Series.
In the next ~30 minutes, you'll have two different sites running under one URL.
We’ll use a Cloudflare Worker to:
It will be ugly, fragile, and not production-ready. That’s the point. You’re learning the shape of the thing.
End goal: a Cloudflare Worker that does this:
You can swap in your own Webflow projects later. For now, we’ll use placeholders.
You’ll need:
Make a directory and initialise a new bun project.
From your terminal:
mkdir reverse-proxy-mwe
cd reverse-proxy-mwe
bun init
When Bun asks about templates, pick the simplest option (or just hit Enter).
Now:
mkdir src
touch src/index.js
If Bun created a src/index.ts for you, you can delete it.
Wrangler is Cloudflare’s CLI for deploying Workers.
Inside your project:
bun i wrangler
This adds Wrangler to your project so you can run it with bunx.
Open src/index.js and paste this:
export default {
async fetch(request) {
const url = new URL(request.url);
let targetUrl;
// If the path starts with /blog, send the user to Site B
if (url.pathname.startsWith('/blog')) {
targetUrl = 'https://site-b.webflow.io';
} else {
// Everything else goes to Site A
targetUrl = 'https://site-a.webflow.io';
}
const response = await fetch(targetUrl);
return response;
},
};Replace:
Keep them as full https:// URLs.
The code simply exports an object with a fetch function in it. The function gets the requested url, checks if it starts with /blog or not and fetches the data from the relevant project.
Create a wrangler. toml file in the project root:
touch wrangler.toml
Add this:
name = "my-super-simple-reverse-proxy"
main = "src/index.js"
compatibility_date = "2024-01-01"You can set compatibility_date to today’s date in YYYY-MM-DD format if you prefer, but it must be a real date, not in the future.
This is what wrangler will read for your configuration in Cloudflare.
From the project root:
bun wrangler deploy
The first time you run this, Wrangler will:
Follow the prompts, then run bun wrangler deploy again if it didn’t finish.
At the end, Wrangler will print something like:
https://my-super-simple-reverse-proxy.your-name.workers.dev
That’s your Worker URL.
Open the Worker URL in your browser:
If that works, your reverse proxy is alive.
You now have:
It’s not:
And that’s fine.
You’ve just spun up a very simplistic reverse proxy.
Next, we’ll start tightening it up and making it behave more like something you’d trust on a real domain.
Hono.js replaces messy if/else chains with clean, readable routing to build a reverse proxy that scales
Reverse proxies are the gateway drug to Webflow Enterprise. Almost every enterprise project I’ve been involved in has implemented it in some form.
Build an automated sync between Webflow's CMS and Algolia's search service using Cloudflare Workers.
If you’ve ever used Webflow’s native background video component and thought “damn, that looks rough” I'm here for you.
As more companies move to Webflow and demand for Webflow Enterprise grows, you’ll see more teams leaning on reverse proxies to solve some of Webflow’s infrastructure limitations.
A small keyboard shortcut can make a marketing site feel faster, more intentional, and “app-like” with almost no extra design or development
A practical, code-heavy dive into GSAP’s utility functions—keyframes, pipe, clamp, normalize, and interpolate—and why they’re so much more than just shortcuts for animation math.
GSAP lets you pass _functions_ as property values. I've known this for a while but never really explored it particularly deeply. Over the last couple of weeks I've been testing, experimenting and getting creative with it to deepen my understanding.
Exploring ways to keep JavaScript modular and maintainable in Webflow — from Slater to GitHub to a custom window.functions pattern. A look at what’s worked (and what hasn’t) while building more scalable websites.