Reverse Proxy & Routing Rules
Reverse-proxy paths on your domain to Ploy pages or external origins — no full migration required.
Ploy ships a built-in reverse proxy at the edge of your domain. You point DNS at Ploy, and Ploy decides per-request whether to serve an AI-built Ploy page, forward the request to an external origin (Webflow, Vercel, Cloudflare, AWS, Google Cloud Run, your own app), or redirect. Visitors see a single, unified site; behind the scenes, traffic is split across as many backends as you want.
The split is controlled by Routing Rules — the configuration layer for the reverse proxy. Each rule matches an incoming request by path prefix or regex and dispatches it to a Ploy site, proxies it to an external origin, or issues a redirect. Rules are evaluated top-to-bottom; the first match wins.
The walkthrough below uses Webflow as the example origin, but the proxy mechanism is provider-agnostic — Vercel, Cloudflare Pages/Workers, AWS, Google Cloud Run, and any other host that exposes a stable URL all work the same way. See Fallback Origins for per-provider setup notes (where to find the origin URL, Host-header rules, and Default fallback proxy examples).
How Routing Rules Work
When you point your domain’s DNS to Ploy, all incoming traffic flows through Ploy’s edge network first. Ploy then decides where to send each request based on the routing rules you’ve configured:
| Rule Type | Action | Description |
|---|---|---|
Path Prefix | Ploy Site | Matches any request whose path starts with the given prefix. Routes to a specific Ploy-built site. |
Regex | Proxy | Matches requests using a regular expression pattern. Proxies the request to an external origin URL (e.g. your Webflow site). |
Key concept: Rules are evaluated top-to-bottom. The first matching rule wins. Place specific path rules above your catch-all proxy rule so Ploy pages take priority, and everything else falls through to your existing site.
Step-by-Step Setup
Follow these steps to serve Ploy-built pages alongside your existing site. The entire process takes about 15–20 minutes.
Step 1: Set up your origin host
Your existing site needs to remain reachable on a stable URL that Ploy can proxy to — usually a dedicated subdomain like wf-origin.yourdomain.com (Webflow) or a provider-issued URL like your-app.vercel.app. Your visitors never see it directly.
See Fallback Origins for per-provider instructions — Webflow, Vercel, Cloudflare Pages/Workers, AWS, Google Cloud Run, and more. Come back here once your origin is serving traffic over HTTPS.
Step 2: Add a Test Domain in Ploy
Before moving your production domain, set up a test subdomain so you can verify everything works.
- In the Ploy dashboard, navigate to Sites → Settings and find the Custom Domains section.
- Add a new domain:
ploy-test.yourdomain.com. - In your DNS provider, create the records Ploy provides for this domain (typically a
CNAMEorArecord). See Custom Domain Setup for DNS specifics. - Wait for DNS propagation and SSL provisioning (usually a few minutes).
Step 3: Configure Routing Rules
This is the core of the setup. You’ll tell Ploy which paths to serve directly and which to proxy through to your Webflow origin. In the Ploy dashboard, go to Routing Rules for your test domain. You’ll create rules in two categories:
Ploy page rules (Path Prefix)
For each page or section you want Ploy to serve, add a Path Prefix rule with the action set to “Ploy Site” and select the site you’ve built.
Example — to serve a new /experience page from Ploy:
| Match | Path | Action | Site |
|---|---|---|---|
| Path Prefix | /experience | Ploy Site | your-site |
Don’t forget static assets: If your Ploy site uses a framework like Astro, you may also need a Path Prefix rule for the asset directory (e.g.
/_astro) so CSS, JS, and images load correctly.
Catch-all proxy rule (Regex)
Below your Ploy page rules, add a catch-all rule that forwards everything else to your Webflow origin subdomain. This ensures your existing site continues to work for all other paths.
| Match | Pattern | Action | Origin URL | Host |
|---|---|---|---|---|
| Regex | /(.*) | Proxy | https://ploy-origin.yourdomain.com/($1) | Rewrite |
The /(.*) pattern captures the full request path and passes it through to your Webflow origin via the ($1) substitution. Setting Host to Rewrite ensures Webflow receives the correct hostname for your origin subdomain.
Final rule order
Your final rule list might look like this, from top to bottom:
| # | Type | Path / Pattern | Action | Target |
|---|---|---|---|---|
| 1 | Prefix | /experience | Ploy Site | your-site |
| 2 | Prefix | /_ploy_static | Ploy Site | your-site |
| 3 | Prefix | /blog | Proxy | blog-origin.yourdomain.com |
| 4 | Regex | ^/(app|api|auth) | Proxy | backend-app.yourdomain.com |
| 5 | Default Fallback Origin | ploy-fallback-origin.yourdomain.com |
Specific Ploy paths are listed first so they match before the catch-all. The catch-all proxy at the bottom ensures every other path is forwarded to the default fallback origin.
Step 4: Test Your Setup
With your test domain configured, verify that both Ploy and Webflow are serving correctly:
- Ploy pages — Visit
ploy-test.yourdomain.com/experience. This should render your Ploy-built page. - Cloudflare or Webflow or Vercel pages — Visit
ploy-test.yourdomain.com(or any path not covered by a Ploy rule). This should render your pre-existing provider's hosted content. - Assets — Inspect the page and confirm that CSS, JavaScript, images, and fonts are all loading without errors.
Common issues: If your Ploy page loads but styles are missing, you likely need to add an asset path rule (e.g.
/_ploy_static/_astro). If your Webflow site shows an SSL error, double-check that theploy-originsubdomain DNS has propagated and that Webflow has issued an SSL certificate for it.
Step 5: Go Live
Once everything checks out on your test domain, you’re ready to move your production domain to Ploy.
- In Ploy, add your production domain (e.g.
yourdomain.com) as a Custom Domain. - Update your production domain’s DNS records to point to Ploy (same records as the test domain). For an apex domain (
acme.comwith no subdomain), you will likely use anArecord vs. aCNAME— unless your domain registrar supports CNAME flattening (e.g. AWS and Cloudflare). - Copy over the same routing rules from your test domain.
- Verify everything works on the production domain.
Tip: You can remove the test domain and its DNS records after going live, or keep it around as a staging environment for testing future changes.
JSON Reference
For advanced users, here’s the underlying JSON structure for a typical routing configuration. This can be viewed and edited via the JSON tab in the Routing Rules editor.
{
"rules": [
{
"action": {
"type": "dispatch",
"workerName": "your-site-worker-id"
},
"pathPrefix": "/experience"
},
{
"action": {
"type": "dispatch",
"workerName": "your-site-worker-id"
},
"pathPrefix": "/_astro"
},
{
"action": {
"type": "proxy",
"originUrl": "https://ploy-origin.yourdomain.com/($1)",
"preserveHostHeader": false
},
"pattern": "/(.*)"
}
]
}| Field | Description |
|---|---|
type: "dispatch" | Routes the request to a Ploy-hosted site (worker). |
type: "proxy" | Forwards the request to an external origin URL. |
pathPrefix | Matches requests whose path starts with this value. |
pattern | A regex pattern for flexible path matching. |
originUrl | The upstream URL to proxy to. Use ($1) to pass the captured path. |
preserveHostHeader | When false, rewrites the Host header to match the origin (required for Webflow). |
FAQ
Will this affect my existing Webflow site?
No. Your Webflow site stays fully published and functional on the ploy-origin subdomain. Visitors won’t see or interact with the origin subdomain directly — they’ll only see your main domain.
Can I add more Ploy pages later?
Yes. Simply add new Path Prefix rules above the catch-all proxy rule for any additional pages you want Ploy to serve.
What if I want to migrate my entire site to Ploy?
Remove the catch-all proxy rule. Once you do, all traffic will be handled by Ploy’s default worker, which serves your Ploy-built site. You can then decommission the Webflow origin subdomain.
Does order matter for the rules?
Yes. Rules are evaluated top-to-bottom, and the first match wins. Always place specific path rules above the catch-all proxy.
What’s Next?
- Connect your domain — See Custom Domain Setup for DNS records and SSL provisioning.
- Publish your Ploy site — Follow the Publishing & Deploys guide to ship your Ploy-built pages.
- Troubleshoot — Check the FAQ & Troubleshooting page for common issues.
- Need help? — Email support@runploy.com for routing and proxy issues.

Key concept: Rules are evaluated top-to-bottom. The first matching rule wins. Place specific path rules above your catch-all proxy rule so Ploy pages take priority, and everything else falls through to your existing site.
Don’t forget static assets: If your Ploy site uses a framework like Astro, you may also need a Path Prefix rule for the asset directory (e.g.