message: docs: add documentation about domainRedirects input
diff: @@ -390,6 +390,7 @@ The fourth cache behaviour handles next API requests `api/*`.
  | Name | Type | Default Value | Description |
  | ------------------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | domain | `Array` | `null` | For example `['admin', 'portal.com']` |
  +| domainRedirects | `object` | `{}` | Adds domain-level redirects at the edge using a 308 redirect. Specify an object of domain name -> redirect destination with protocol. For example, `www.example.com: https://example.com`. See [here](https://github.com/serverless-nextjs/serverless-next.js#i-was-expecting-for-automatic-subdomain-redirection-when-using-the-domaintype-wwwapex-input) for more information. |
  | bucketName | `string` | `null` | Custom bucket name where static assets are stored. By default is autogenerated. |
  | bucketRegion | `string` | `null` | Region where you want to host your s3 bucket. Make sure this is geographically closer to the majority of your end users to reduce latency when CloudFront proxies a request to S3. |
  | nextConfigDir | `string` | `./` | Directory where your application `next.config.js` file is. This input is useful when the `serverless.yml` is not in the same directory as the next app. <br>**Note:** `nextConfigDir` should be set if `next.config.js` `distDir` is used |
  @@ -561,7 +562,28 @@ myNextApp:
  #### I was expecting for automatic subdomain redirection when using the domainType: www/apex input
  -The redirection is not currently implemented, but there is a manual workaround outlined [here](https://simonecarletti.com/blog/2016/08/redirect-domain-https-amazon-cloudfront/#configuring-the-amazon-s3-static-site-with-redirect).
  +You can use the new `domainRedirects` input, along with forwarding `Host` header and `domainType: both`, to redirect requests to the correct domain. See example configuration below that redirects `www.example.com` requests to `https://example.com`.
  +
  +```yml
  +next-app:
  + component: "../../serverless-components/nextjs-component"
  + inputs:
  + cloudfront:
  + defaults:
  + forward:
  + headers:
  + [
  + Host
  + ]
  + domain: ["example.com"]
  + domainType: "both"
  + domainRedirects:
  + www.example.com: https://example.com
  +```
  +
  +All of this happens within the Lambda@Edge origin request handlers. Please note that this will not allow you to redirect requests at `_next/static/*` or `/static/*`, since those cache behaviors do not have a Lambda@Edge handler attached to them.
  +
  +Otherwise, you can also use the manual workaround using an S3 bucket outlined [here](https://simonecarletti.com/blog/2016/08/redirect-domain-https-amazon-cloudfront/#configuring-the-amazon-s3-static-site-with-redirect).
  In summary, you will have to create a new S3 bucket and set it up with static website hosting to redirect requests to your supported subdomain type (ex. "www.example.com" or "example.com"). To be able to support HTTPS redirects, you'll need to set up a CloudFront distribution with the S3 redirect bucket as the origin. Finally, you'll need to create an "A" record in Route 53 with your newly created CloudFront distribution as the alias target.
  ## Contributing
  