David Alsh
David Alsh

Reputation: 7649

AWS nginx as a service?

I'm looking for a service that allows me to proxy/modify incoming requests inside AWS.

Currently I am using cloudfront, but that has limited functions.

I need to be able to see user agent strings and make proxy decisions based on that - like reverse proxying to another domain, or routing all requests to /index.html.

Anyone know of a service that within AWS - or outside of AWS.

Upvotes: 0

Views: 345

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179114

It sounds like you are describing Lambda@Edge, which is a CloudFront enhancement that allows you to define Lambda functions that will fire at any of 4 hook points in the CloudFront signal flow, and modify the request or generate a dynamic response.

Viewer Request triggers allow inspection/modification of requests and dynamic generation of small responses before the cache lookup.

Origin Request triggers are similar, but fire after the cache is checked. They allow you to inspect and modify the request, including changing the origin server, path, and/or query string, or to generate a response instead of allowing CloudFront to proceed with the connection to the origin.

If the request goes to the origin, then once it returns, an Origin Response trigger can fire to modify the response headers or replace the response body with a different body you generate. The response after this trigger is finished with it is what gets stored in the cache, if cacheable.

Once a reaponse is cached, further firing of the Origin Request and Origin Response triggers doesn't occur for subsequent requests that can be served from the cache.

Finally, when the response is ready, whether it came from the cache or the origin, a Viewer Response trigger can modify it further, if desired.

Response triggers can also inspect many of the headers from the original request.

Lambda@Edge functions are written in Node.js, and are presented with the request or responses as simple structured objects that you inspect and/or modify.

Upvotes: 1

Related Questions