Last active
May 10, 2019 16:40
-
-
Save gouravtiwari/bc47aee75a215518ca7e3bfcb03ec6d3 to your computer and use it in GitHub Desktop.
Lambda@Edge custom origin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateOriginRequest(request) { | |
request.origin = { | |
custom: { | |
domainName: 'some-domain.example.com', // this is the origin where you want to route the request | |
port: 80, // or 443 | |
protocol: 'http', // http or https | |
path: '/some-path', // path of the reqest | |
sslProtocols: ['TLSv1', 'TLSv1.1'], // and any other protocols supported by cloudfront | |
readTimeout: 10, //readTimeout in seconds, | |
keepaliveTimeout: 60, // in seconds | |
customHeaders: {'X-AB-Test': 'A'} // other custom headers | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment