I am using this doc https://aws.amazon.com/blogs/networking-and-content-delivery/adding-http-security-headers-using-lambdaedge-and-amazon-cloudfront/
I am using a react app in S3 bucket, with a cloudfront CDN. I have added a lambdaedge to add a security header
headers['x-frame-options'] = [{key: 'X-Frame-Options', value: 'DENY'}];
headers['x-xss-protection'] = [{key: 'X-XSS-Protection', value: '1; mode=block'}];
It is working fine for the homepage (mySite.com):
But it doesn't work for a different route, example mySite.com/login
When I check the error behavior in cloudFront, there are no options to add a header
Why this page /login
is in error? Because of react router doesn't work in aws s3 bucket