Difference between revisions of "HTTP redirect using lambda handler"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
− | |||
<pre> | <pre> | ||
def lambda_handler(event, context): | def lambda_handler(event, context): | ||
Line 19: | Line 17: | ||
return response | return response | ||
</pre> | </pre> | ||
+ | |||
+ | == Related == | ||
+ | * [[CloudFront Lambda@Edge]] | ||
== See also == | == See also == |
Latest revision as of 10:40, 21 June 2023
def lambda_handler(event, context): # Generate HTTP redirect response with 302 status code and Location header. response = { 'status': '302', 'statusDescription': 'Found', 'headers': { 'location': [{ 'key': 'Location', 'value': 'http://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html' }] } } return response
Related[edit]
See also[edit]
- URL redirection, Subdomain redirection, Lambda@Edge: HTTP redirect using lambda handler, Redirect: HTTP status codes 3xx
- AWS CloudFront, distributions, Invalidations, Amazon CloudFront Ready,
aws cloudfront
, CloudFront Functions, Lambda@Edge, Origin Shield, Signed URL, OAI, Origin Access Control (OAC), Amazon CloudFront edge locations, cloudfront.net, invalidations, CloudFront Security Savings Bundle (CFSSB)
Advertising: