跳到主要内容

Server proxy configurations are grouped under the server.proxy object

In Strapi 5, all proxy configuration options are now configured through the server.proxy object in /config/server.js|ts, whether they are for requests made within strapi.fetch or for the global proxy agent for the koa server.

This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

🔌 Is this breaking change affecting plugins?No
🤖 Is this breaking change automatically handled by a codemod?No

Breaking change description

In Strapi v4

  • server.globalProxy is used to configure all requests through strapi.fetch.
  • server.proxy is used to set the value of koa server’s proxy option.

In Strapi 5

All configuration options are grouped under the server.proxy object.

Migration

This section regroups useful notes and procedures about the introduced breaking change.

Notes

Additional information about how the server.proxy configuration works in Strapi 5 is available in the server configuration documentation.

Manual migration

Users will need to manually update the code:

  • If server.proxy is used, it needs to move to server.proxy.koa.

  • If server.globalProxy is used, you have 2 choices:

    • move it to server.proxy.global and be aware that it will now work for HTTP/HTTPS requests in addition to strapi.fetch requests,
    • or move it to server.proxy.fetch to keep the exact same functionality as in Strapi v4, where only fetch was proxied.