File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212import { Certificate } from "aws-cdk-lib/aws-certificatemanager";
1313import {
1414 Distribution,
15+ ResponseHeadersPolicy,
1516 ViewerProtocolPolicy,
1617} from "aws-cdk-lib/aws-cloudfront";
1718import { S3BucketOrigin } from "aws-cdk-lib/aws-cloudfront-origins";
@@ -57,6 +58,7 @@ export class AppStack extends Stack {
5758 domainNames: [props.domainName],
5859 defaultBehavior: {
5960 origin: S3BucketOrigin.withOriginAccessControl(websiteBucket),
61+ responseHeadersPolicy: ResponseHeadersPolicy.SECURITY_HEADERS,
6062 viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
6163 },
6264 defaultRootObject: "index.html",
@@ -66,6 +68,11 @@ export class AppStack extends Stack {
6668 responseHttpStatus: 200,
6769 responsePagePath: "/index.html",
6870 },
71+ {
72+ httpStatus: 403,
73+ responseHttpStatus: 200,
74+ responsePagePath: "/index.html",
75+ },
6976 ],
7077 });
7178
You can’t perform that action at this time.
0 commit comments