Long time software architect, CTO Authress, creating application security plug-ins for any software application with Authress. Talk to me about security in microservices or service authorization.
This is a great write-up. For what it's worth, I will mention, that this isn't a good use of a lambda, you can just deploy the index.html file twice, once to the /path/index.html and once to the /path/ location, you can also decide to upload it additionally to /path as well. This is a free solution.
Crazy cloud guy with a passion for serverless. Loves to share my knowledge and experience. Holds several AWS, GCP certificates and I'm always aiming for the next one.
Notorious coffee drinker....
There is actually a index.html file present under /path/ . Since links in my blog, consisting of static generated files, points to /path/ and not to /path/index.html CloudFront will request the /path/ from S3, CloudFront doesn't "speak" web server. Since there is no file in S3 called /path/ it will end up with an 404 error. Therefore the Lambda rewrites the path and append index.html so the correct file is requested from S3.
So either I have change all links to point to the actual index.html file or use a Lambda@Edge to do it for me.
Long time software architect, CTO Authress, creating application security plug-ins for any software application with Authress. Talk to me about security in microservices or service authorization.
This is a great write-up. For what it's worth, I will mention, that this isn't a good use of a lambda, you can just deploy the
index.html
file twice, once to the/path/index.html
and once to the/path/
location, you can also decide to upload it additionally to/path
as well. This is a free solution.There is actually a index.html file present under /path/ . Since links in my blog, consisting of static generated files, points to /path/ and not to /path/index.html CloudFront will request the /path/ from S3, CloudFront doesn't "speak" web server. Since there is no file in S3 called /path/ it will end up with an 404 error. Therefore the Lambda rewrites the path and append index.html so the correct file is requested from S3.
So either I have change all links to point to the actual index.html file or use a Lambda@Edge to do it for me.
that's exactly my point, create a file called
/path/
problem solved.