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 throughstrapi.fetch
.server.proxy
is used to set the value of koa serverβsproxy
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 toserver.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 tostrapi.fetch
requests, - or move it to
server.proxy.fetch
to keep the exact same functionality as in Strapi v4, where only fetch was proxied.
- move it to