Service eligibility and regional restrictions
PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.
Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.
Key Takeaways
- Wrangler 4.148.0 or later supports assets.base_path. For cloudflare.config.ts, use worker.assets.basePath with cf 1.0.0-beta.13 or later.
- With /blog configured, build files can stay at the root of dist; Cloudflare maps /blog/ to dist/index.html in its example.
- Worker routes must also cover the /blog prefix. A route limited to example.com/api/* does not handle requests to /blog/.
- With the Cloudflare Vite plugin, set Vite base as well. Account for the public path in _headers, _redirects, assets.run_worker_first and constructed Assets binding requests.
A URL prefix is separate from a disk directory
On November 11, 2026, Cloudflare announced that a Worker can serve static assets under a URL prefix such as example.com/blog/ while the build output stays at the root of assets.directory. After setting base_path, you no longer need to nest the files in a matching blog directory just to match the public URL.
Think of this as two separate layers: assets.directory points to the directory containing the build output, while base_path selects the public URL prefix for those files. The setting changes how the static assets are exposed. Your application routes, Worker routes and build-time asset URLs still need to agree with that public path.
Choose the configuration entry used by the project
For a Wrangler project, use version 4.148.0 or later and set base_path in the assets configuration. Keep the directory pointed at the existing output, for example assets.directory set to ./dist and assets.base_path set to /blog. Wrangler supports configuration formats such as JSON and TOML; follow the syntax of the file the project already uses.
For cloudflare.config.ts, use worker.assets.basePath in the Worker configuration, with Cloudflare CLI cf version 1.0.0-beta.13 or later. Check which CLI and version the project actually runs, then use the matching key. Do not mix Wrangler’s underscore key with the camel-case key for cloudflare.config.ts in one configuration example.
Map files in the build root to /blog/
Suppose dist contains index.html, posts/post1.html and posts/post2.html, and the asset directory is dist with the public prefix set to /blog. Cloudflare documents this mapping: example.com/blog/ serves dist/index.html, and example.com/blog/posts/post1 serves dist/posts/post1.html.
This example maps public URLs to the files already in the build output; it does not require copying the output into dist/blog. Before configuring the prefix, check the actual relative paths in the build artifacts and compare them with the URLs you expect to serve. If the application creates absolute paths or rewrite rules, make sure they still point to the intended /blog/ URLs.
Make the Worker route cover the same prefix
Check the static asset setting and Worker routes together. Cloudflare says Worker routes must include the base path. For example, if the Worker only matches example.com/api/*, a request to example.com/blog/ will not reach that Worker or its static assets. If the Worker should handle those requests, confirm that its route pattern covers /blog/.
Requests outside /blog do not resolve to these static assets; a Worker handles them only when a Worker route matches. When investigating a 404 or an unexpected Worker response, record the request URL, Worker route and assets.base_path separately, then check whether the request matches the required paths. Do not stop after checking that a file exists.
Keep Vite and asset rules on the public path
If you build with the Cloudflare Vite plugin, also set Vite base to /blog/. Script, stylesheet and other asset URLs generated by Vite need to use the mounted public address. Setting Cloudflare base_path alone does not replace the build tool’s configuration for page asset URLs.
Cloudflare says paths in _headers, _redirects and assets.run_worker_first use the public URL path, so the documented example includes /blog. When maintaining these rules, treat the prefix as part of the path and check that static assets, redirects and requests routed to the Worker all refer to the same public URL.
Troubleshoot Assets binding paths and 404s
Requests made through the Assets binding also use the mounted public path. Cloudflare’s example is env.ASSETS.fetch("https://assets.local/blog/posts/post1"); if your code constructs the request, include /blog in the pathname. The documentation says you can forward the original request unchanged when passing it through to the Assets binding.
When something fails, check the CLI and version, the active configuration key, build-file paths, base_path, Worker route, Vite base, and the full paths in _headers, _redirects and assets.run_worker_first. This guide is based on Cloudflare’s November 11, 2026 announcement and documentation; it does not inspect any particular account, project configuration or deployment.
Sources
Frequently Asked Questions
Do I need to create a dist/blog directory after setting /blog?
No. The feature lets build files stay at the root of assets.directory, then mounts them under a public URL prefix such as /blog using base_path.
Can a Worker with only an example.com/api/* route handle /blog/ assets?
No. Cloudflare says Worker routes must include the configured base path. A route that only matches /api/* does not cover /blog/ requests.
Is base_path the only setting I need with the Cloudflare Vite plugin?
No. Cloudflare also says to set Vite base to the public prefix, such as /blog/, so URLs in the build output match the mounted path.