Before you start
- 1.Your domain is already managed through Cloudflare (DNS proxied through Cloudflare).
- 2.Similar AI has provisioned your subdomain, e.g.
yourstore.page.similar.ai. If you have not received this, contact your Similar AI account manager. - 3.You have completed the new page onboarding checklist.
Step 1 - Create a Cloudflare Worker
- a.Go to
dash.cloudflare.comand navigate to Workers & Pages. - b.Click Create Application and set a name, for example
reverse-proxy. - c.Click Edit Code and paste the following script. Replace
client.comwith your domain andclient.page.similar.aiwith the subdomain Similar AI provisioned for you.
async function handleRequest(request) {
let url = new URL(request.url)
let target = ORIGINS[url.hostname]
if (target) {
url.hostname = target
return fetch(url, request)
}
return fetch(request)
}
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const ORIGINS = {
'client.com': 'client.page.similar.ai',
}Double-check that you replaced client.com with your actual domain in the ORIGINS object before deploying.
Step 2 - Add a Workers Route
- a.In the Cloudflare dashboard, go to Workers Routes and click Add route.
- b.In the Route field, enter your domain followed by the folder path you want to use, for example:
yourstore.com/s/*. The trailing wildcard ensures all paths under that folder are proxied. - c.In the Worker dropdown, select the
reverse-proxyworker you created in Step 1. - d.Click Save.
How the proxy works
When a visitor requests a URL that matches your Workers Route (e.g. yourstore.com/s/blue-widgets), Cloudflare intercepts the request before it reaches your origin server. The Worker rewrites the hostname to your Similar AI subdomain and forwards the request. The response is returned to the visitor as if the page lived on your own domain.
This means your visitors see your domain in the address bar, search engines index the pages under your domain, and you keep full control of DNS and SSL through Cloudflare.
Request arrives
Visitor hits yourstore.com/s/blue-widgets
Worker rewrites hostname
Cloudflare forwards to yourstore.page.similar.ai
Page served under your domain
Visitor sees your URL, search engines index your domain
Not using Cloudflare?
If your site is not behind Cloudflare, you can achieve the same result with an Nginx reverse proxy. See the Nginx reverse proxy integration guide for instructions.
Frequently asked questions
Why do I need a Cloudflare Workers reverse proxy for Similar AI new pages?
The New Pages Agent generates SEO-optimized category, collection, and landing pages that need to be served under your own domain so search engines attribute authority directly to your site. A Cloudflare Workers reverse proxy routes requests for those URLs to Similar AI's infrastructure without requiring changes to your origin server or platform code.
Will the reverse proxy setup slow down my site's page load times?
Cloudflare Workers execute at the edge, meaning requests are handled at a data center close to each visitor rather than being routed back to a central origin. Because Similar AI new pages are also cached at the edge, latency overhead is minimal and Core Web Vitals scores on existing pages are unaffected.
Which URL routes should I configure the Worker to intercept?
You only need to proxy the path prefixes where the New Pages Agent publishes content, such as specific category or guide subdirectories you define during onboarding. All other routes pass through to your existing origin unchanged, so your live store continues to operate normally.
Do I need a paid Cloudflare plan to use this integration?
The integration works on Cloudflare's free Workers plan for lower-traffic deployments, though the paid Workers Paid plan is recommended for stores with high request volumes to avoid CPU and request limits. Check the route configuration section of the guide for plan-specific limits that may apply to your catalog size.
How does the proxy handle pages that Similar AI hasn't created yet?
The Worker script includes a fallback condition that passes the request to your origin server whenever a requested URL isn't found in the Similar AI new pages registry. This ensures visitors and crawlers never encounter errors for URLs that exist only on your platform, keeping your existing SEO signals intact.
Ready to serve new pages under your domain?
Get started with Similar AI new pages. We handle page creation, content, and internal linking - you control how pages are served on your site.