diff --git a/docs/cloud/redirects.md b/docs/cloud/redirects.md index 5b960fec9..22027bbd8 100644 --- a/docs/cloud/redirects.md +++ b/docs/cloud/redirects.md @@ -127,3 +127,18 @@ rewrites: pathname: '/(favicon.ico|.well-known|dist)/*?' destination: '{artifactBaseUrl}/{request.uri}' ``` + +### Custom Headers + +You can set arbitrary HTTP headers on any rewritten response by including a key-value map under a `headers` key: + +```yml +rewrites: + - pattern: + pathname: '/dist/js/*' + destination: '{artifactBaseUrl}/{request.uri}' + headers: + Access-Control-Allow-Origin: 'https://mydomain.com' +``` + +Headers are combined with those from the `destination`, overwriting any shared names.