Example code for CloudFront Functions
Use the following example functions to help you get started writing function code for CloudFront
Functions. All of these examples are available in the amazon-cloudfront-functions
repository on GitHub
Examples
- Add a Cache-Control header to the response
- Add a cross-origin resource sharing (CORS) header to the response
- Add cross-origin resource sharing (CORS) header to the request
- Add security headers to the response
- Add a True-Client-IP header to the request
- Redirect the viewer to a new URL
- Add index.html to request URLs that don’t include a file name
- Validate a simple token in the request