Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This page lists all the breaking changes introduced in Strapi 5.
* [Model config path uses uid instead of dot notation](/dev-docs/migration/v4-to-v5/breaking-changes/model-config-path-uses-uid)
* [The `webhooks.populateRelations` server configuration is removed](/dev-docs/migration/v4-to-v5/breaking-changes/remove-webhook-populate-relations)
* [The `defaultIndex` option is removed from the `public` middleware](/dev-docs/migration/v4-to-v5/breaking-changes/default-index-removed)
* [Server proxy configuration options are grouped under the `server.proxy` object](/dev-docs/migration/v4-to-v5/breaking-changes/server-proxy)

## Content API

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Server proxy configuration
description: In Strapi 5, all proxy configuration options are now configured through the 'server.proxy' object in the '/config/server.js|ts' instead of having various option names such as 'globalProxy' and 'proxy' in Strapi v4.
displayed_sidebar: devDocsMigrationV5Sidebar
tags:
- breaking changes
- configuration
- server
---

import Intro from '/docs/snippets/breaking-change-page-intro.md'
import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.md'
import NoPlugins from '/docs/snippets/breaking-change-not-affecting-plugins.md'
import NoCodemods from '/docs/snippets/breaking-change-not-handled-by-codemod.md'

# 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](https://koajs.com/) server.

<Intro />
<NoPlugins />
<NoCodemods />

## Breaking change description

<SideBySideContainer>

<SideBySideColumn>

**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.

</SideBySideColumn>

<SideBySideColumn>

**In Strapi 5**

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

</SideBySideColumn>

</SideBySideContainer>

## Migration

<MigrationIntro />

### Notes

Additional information about how the `server.proxy` configuration works in Strapi 5 is available in the [server configuration](/dev-docs/configurations/server) 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.
1 change: 1 addition & 0 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ const sidebars = {
},
'dev-docs/migration/v4-to-v5/breaking-changes/remove-webhook-populate-relations',
'dev-docs/migration/v4-to-v5/breaking-changes/default-index-removed',
'dev-docs/migration/v4-to-v5/breaking-changes/server-proxy',
]
},
{
Expand Down