Skip to content

Commit 7561483

Browse files
feat: addressed comments
1 parent ca5d641 commit 7561483

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/build/next.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const setNextOptions = async (nextConfigPath: string, s3BucketName: string) => {
2727
const updatedConfig = {
2828
...currentConfig,
2929
output: 'standalone',
30-
...currentConfig.serverRuntimeConfig,
3130
serverRuntimeConfig: {
31+
...currentConfig.serverRuntimeConfig,
3232
nextServerlessCacheConfig: cacheConfig
3333
},
3434
cacheHandler: require.resolve(path.join('..', 'cacheHandler', 'index.js'))

src/cdk/constructs/CloudFrontDistribution.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export class CloudFrontDistribution extends Construct {
7070
})
7171

7272
const s3Origin = new origins.S3Origin(staticBucket)
73+
const nextServerOrigin = new origins.HttpOrigin(ebAppDomain, {
74+
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY,
75+
httpPort: 80
76+
})
7377

7478
this.cf = new cloudfront.Distribution(this, id, {
7579
defaultBehavior: {
@@ -99,10 +103,7 @@ export class CloudFrontDistribution extends Construct {
99103
cachePolicy: splitCachePolicy
100104
},
101105
'/_next/image*': {
102-
origin: new origins.HttpOrigin(ebAppDomain, {
103-
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY,
104-
httpPort: 80
105-
}),
106+
origin: nextServerOrigin,
106107
cachePolicy: imageCachePolicy
107108
},
108109
'/_next/*': {

0 commit comments

Comments
 (0)