You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
@@ -98,8 +99,9 @@ In most cases you wouldn't want to use CloudFront's distribution domain to acces
98
99
99
100
You can use any domain name but you must be using AWS Route53 for your DNS hosting. To migrate DNS records from an existing domain follow the instructions
100
101
[here](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html). The requirements to use a custom domain name:
101
-
* Route53 must include a _hosted zone_ for your domain (e.g. `mydomain.com`) with a set of nameservers.
102
-
* You must update the nameservers listed with your domain name registrar (e.g. namecheap, godaddy, etc.) with those provided for your new _hosted zone_.
102
+
103
+
- Route53 must include a _hosted zone_ for your domain (e.g. `mydomain.com`) with a set of nameservers.
104
+
- You must update the nameservers listed with your domain name registrar (e.g. namecheap, godaddy, etc.) with those provided for your new _hosted zone_.
103
105
104
106
The serverless next.js component will automatically generate an SSL certificate and create a new record to point to your CloudFront distribution.
To specify your own CloudFront inputs, just add any [aws-cloudfront inputs](https://github.com/serverless-components/aws-cloudfront#3-configure) under `cloudfront`:
131
+
132
+
```yml
133
+
# serverless.yml
134
+
135
+
myNextApplication:
136
+
component: serverless-next.js
137
+
inputs:
138
+
cloudfront:
139
+
my-page/*:
140
+
ttl: 0
141
+
forward:
142
+
cookies: "all"
143
+
queryString: false
144
+
my-other-page:
145
+
viewerProtocolPolicy: redirect-to-https
146
+
```
147
+
148
+
This is particularly useful for caching any of your next.js pages at CloudFront's edge locations. See [this](/https://github.com/danielcondemarin/serverless-next.js/tree/master/packages/serverless-component/examples/app-with-custom-caching-config) for an example application with custom cache configuration.
149
+
126
150
### AWS Permissions
127
151
128
152
By default the Lambda@Edge functions run using AWSLambdaBasicExecutionRole which only allows uploading logs to CloudWatch. If you need permissions beyond this, like for example access to DynamoDB or any other AWS resource you will need your own custom policy arn:
@@ -229,6 +253,7 @@ The fourth cache behaviour handles next API requests `api/*`.
229
253
| build.cwd | `string` | `./` | Override the current working directory |
230
254
| build.enabled | `boolean` | `true` | Same as passing `build:false` but from within the config |
231
255
| build.env | `object` | `{}` | Add additional environment variables to the script |
256
+
| cloudfront | `object` | `{}` | Inputs to be passed to [aws-cloudfront](https://github.com/serverless-components/aws-cloudfront) |
0 commit comments