Reverse Proxy & Path Routing

Hosting

Last updated

Reverse-proxy paths on your domain to Ploy pages or external origins, with 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)
  • redirect

Visitors see a single, unified site. Behind the scenes, traffic is split across as many backends as you want.

How paths are evaluated

The split is controlled by Path routing, the configuration layer for the reverse proxy. You find it on each domain's page.

  • Each path matches an incoming request: a page and every page under it, only that page, or a custom regex pattern.
  • It then sends the request to a Ploy site, proxies it to another URL, or redirects it.
  • Paths are checked top to bottom. The first match wins.
  • The last row, Everything else, decides where every request goes that no path matches.

Planning redirects for a migration? See the Migration Readiness Checklist.

The walkthrough below sends specific paths to a Ploy site and points Everything else at your existing site. Origin providers can have different hostname and HTTPS requirements. See Fallback Origins for background, then check your provider's requirements and test your configuration before moving production traffic.

To manage the complete routing document from the command line, use ploy site routing get and ploy site routing set. See Routing rules in the Ploy CLI for hostname selection, dry runs, and safe replacement behavior.


How Path Routing Works

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 paths you’ve set up in Path routing. Each path has a match and a destination.

MatchWhat it matches
This page and every page under itThe path and everything below it. /blog matches /blog, /blog/a, and /blog/a/b.
Only this pageThat exact path. Use / for the home page.
Custom pattern (regex)A regular expression tested against the path. Use Try a path to check it before you save. Redirect targets can use $1, $2 for its groups.
DestinationWhat happens
A Ploy sitePick this site or another site in your workspace. Ploy serves the page.
Another URLPloy proxies the request to that URL, such as your Webflow site. The address bar keeps your domain.
Another URL with Redirect insteadVisitors land on the URL itself, so the address bar changes. Choose the redirect type under More options. The default is a permanent (301) redirect.

Key concept: Paths are checked top to bottom. The first matching path wins. Keep specific paths above broader ones. Drag a row, or use Move up and Move down in its menu, to change the order. If a path can never be reached because one above catches it first, Ploy says so on the row. Requests that match no path go to Everything else, the last row in the list.


Prepare a routing change with Ploy

Your plan must support a custom domain. Owners, Admins, and Members can apply routing changes. An additional confirmation may be required.

To find the current paths, open your site, select Domains, then select the domain. Path routing is on the domain's page. You can edit paths there yourself, or ask Ploy's Agent to prepare a proposal in a chat. A proposal is not saved immediately.

  1. Request the change in a chat. Name the domain and the paths you want to change.
  2. Open Review changes in the chat card.
  3. Examine the differences and confirm the affected domain.
  4. Choose Apply changes only if the proposal is correct. Complete any additional confirmation shown.
  5. Wait for the change to finish, then return to the domain's page and confirm the paths in Path routing.
  6. Test the affected public paths, including pages and assets that should remain unchanged.

If the paths changed after the proposal was prepared, the card says so. Ask Ploy's Agent for a fresh proposal. If the card says the routing was saved but edge sync failed, do not assume visitors are already seeing the new routing.


Step-by-Step Setup

Follow these steps on a test domain before changing production routing. Your plan must support custom domains. Owners, Admins, and Members can apply the changes.

Step 1: Set up your origin host

Your existing site needs a stable HTTPS origin URL, such as https://origin.example.com, that continues to serve it after you change routing. Confirm the origin URL and hostname requirements with your provider. Test that the origin serves the expected pages and assets.

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.

  1. Open your site, select Domains, then select Add domain.
  2. Choose Set it up yourself and enter a test subdomain, such as ploy-test.example.com.
  3. Add the records shown for that test domain. See Custom Domain Setup for the domain-connection steps.
  4. Wait until the domain shows Live before testing routing.

Step 3: Configure Path Routing

Open your site, select Domains, then select the test domain. Path routing is on the domain's page.

Path routing on a domain's page with Add path, the options menu, and an All pages row sent to this site
  1. Select Add path for each path Ploy should serve. Enter the path, keep This page and every page under it or choose another match, and pick the Ploy site that has the page as the Destination. Then select Save.Add path dialog with Match set to This page and every page under it, the path /blog, Destination set to Another URL, and Redirect instead unchecked
  2. Check the asset paths used by those pages. If their styles, scripts, images, or fonts need their own paths, add paths for those actual locations. Do not assume every site uses the same asset directory.
  3. Keep specific paths above broader ones. The first matching path wins.
  4. Open the menu on the Everything else row (called All pages until you add a path) and edit it. Set Destination to Another URL and enter the HTTPS origin URL for your existing site. This handles paths that match none of the paths above.Destination dialog for the row that covers all pages, with Destination set to This site
  5. Under More options, set Keep the original domain in the Host header according to your origin provider's requirements. Verify the choice on the test domain.

This walkthrough uses the Everything else row, not a catch-all path. Do not add a catch-all path as an extra step.

Example configuration

RowExampleExpected result
Path/experience, with This page and every page under it and your Ploy site as the destinationMatching requests go to the Ploy site.
Additional paths, if neededThe actual paths used by the Ploy page's assetsThose files load from the intended site.
Everything else, the last rowAnother URL: https://origin.example.comUnmatched requests go to the existing site's origin.

Keep the original domain in the Host header controls whether the original request's hostname is passed to the origin. Ploy notes it is needed for Webflow and similar platforms, but there is no universal choice for every provider. Check your provider's requirements and test the result.

Step 4: Save and review

  1. Each change saves when you select Save in the path dialog. Ploy confirms with "Routing saved. Changes usually take effect within 60 seconds."
  2. Review the list and confirm the rule order, selected Ploy site, Everything else destination, and Host header choice. Rows that use proxy options show them, such as Keeps host header.
  3. If a change was wrong, select Undo in the confirmation. To go further back, open the ⋯ menu next to Add path, choose History, and restore an earlier version. Ploy shows the changes before it restores.History dialog listing saved versions of a domain's routing, with the current version marked
  4. If Ploy says the routing was saved but edge sync needs a retry, select Retry edge sync. Do not assume the new routing is live until it succeeds.
  5. To check where a URL goes, choose Test a URL from the same ⋯ menu.

Prefer to edit everything at once? Choose Edit as JSON from the ⋯ menu, then Review changes and Apply changes. If the routing changed elsewhere while you were editing, Ploy loads the latest version. Check it before changing anything.

Step 5: Test both paths and their assets

  1. Open the Ploy path on the test domain, such as https://ploy-test.example.com/experience. Confirm that it shows the intended Ploy page.
  2. Open a known existing-site path that matches none of the Ploy paths. Confirm that it shows the expected content from the fallback origin.
  3. Check both pages' styles, scripts, images, and fonts. Exercise their important links and interactions, stopping before any action that would submit data or make a change.
  4. If either path fails, review the matching paths, the Everything else destination, and provider requirements before moving production traffic.

If a page loads without its assets, check the files' actual request paths rather than adding a broad path that could take traffic away from your existing site.

Step 6: Prepare the production domain

Only move production traffic after the test-domain checks pass. Follow Custom Domain Setup using the records shown for the production domain, not assumed copies of the test domain's records.

When the production domain already shows another site, setup asks how to route it. Choose Serve only some pages from this site, enter the other site's address, and list the paths Ploy should serve. You can change this later in Path routing.

Review the production domain's paths and Everything else row separately. Repeat Save and review, then test both the Ploy and existing-site paths and their assets on the public production domain. Keep the origin available while any traffic still depends on it.


FAQ

Does my existing site need to stay hosted?

Yes, while Everything else sends traffic to it. Routing does not replace your existing site's hosting. Keep its origin available and check both sets of pages before and after a routing change.

Can I add more Ploy pages later?

Yes. Select Add path for the new pages and any required assets, save, then test them. Unmatched paths continue to use Everything else.

What if I want to migrate my entire site to Ploy?

First check that Ploy has the pages, assets, and behavior you need to replace the existing site. Plan and review the routing change separately before you point Everything else at this site. Do not remove the old origin while pages or assets still rely on it.

Does order matter for the rules?

Yes. Paths are checked top to bottom, and the first match wins. Keep specific paths above broader ones. Everything else applies only when no path matches.


What’s Next?