Skip to content

Internal proxy to API#

While in development, Volto has an internal proxy to the backend API enabled by default. It provides a better developer experience out of the box, so the developer doesn't has to deal with CORS and can focus in develop/test drive/demo Volto.


By default, Volto expects a Plone backend located at http://localhost:8080/Plone. These are the settings that allows you to configure the API and how the proxy works:

  • apiPath [API_PATH] - URL of the backend, used through Volto. By default, the proxy URL.
  • devProxyToApiPath - The real backend URL, used by the proxy. By default, http://localhost:8080/Plone


You don't want to deal with CORS in your production deployments, so the proxy is only enabled in development mode (e.g yarn start)


You can disable the proxy by redefining a new apiPath and redefining an empty devProxyToApiPath setting.

Here are some examples.

Redefining the proxy target#

You can redefine the local proxy target by using the RAZZLE_DEV_PROXY_API_PATH or devProxyToApiPath in the configuration object.

export const settings = {
  devProxyToApiPath: 'http://localhost:8081/mysite',

or use the environment variable:

RAZZLE_DEV_PROXY_API_PATH=http://localhost:8081/mysite yarn start

Disabling the proxy#

export const settings = {
  apiPath: process.env.RAZZLE_API_PATH || `http://localhost:8081/mysite`, // for Plone
  devProxyToApiPath: '', // Set it to '' for disabling the proxy

or use the environment variable:

RAZZLE_API_PATH=http://localhost:8081/mysite yarn start

Advanced usage#

It's possible to define the proxy target more accuratelly using the RAZZLE_PROXY_REWRITE_TARGET environment variable, or the proxyRewriteTarget setting in the configuration object.

This allows you to run Volto against an external (not local) site, e.g. for debugging purposes. In theory then, this is possible: