41

enter image description here

The system

I have an API deployed on EC2 machines on AWS. Incoming HTTPS requests are passed to an elastic load balancer. The load balancer handles the SSL, and passes the request to an Nginx server, that proxies the requests to the specific servers according to the request URL.

The pain

Nginx machines require a lot of maintenance work, especially when servers IP addresses are changed. Moreover, URL-based proxy routing really seems like a natural continuation of a load balancer. Having a sane web-based or API-based interface to control URL routing would be a tremendous boon.

The question

Is there any cloud-based routing solution that can proxy HTTP requests by URL schemas, replacing my Nginx machine?

  • Are you using a configuration management tool ? – user9517 Jul 30 '15 at 22:38
  • Yes, I use ansible. – Adam Matan Aug 1 '15 at 7:48
  • If you need multiple hosting services (e.g. you don't want to be locked into just AWS) you could try out routepath.app – emptyflash Aug 22 '19 at 11:16
30

You can use AWS API Gateway (documentation).

API Gateway helps developers deliver robust, secure and scalable mobile and web application backends. API Gateway allows developers to securely connect mobile and web applications to business logic hosted on AWS Lambda, APIs hosted on Amazon EC2, or other publicly addressable web services hosted inside or outside of AWS. With API Gateway, developers can create and operate APIs for their backend services without developing and maintaining infrastructure to handle authorization and access control, traffic management, monitoring and analytics, version management and software development kit (SDK) generation.

API Gateway now supports HTTP Proxy integration for pass-through resources, so you don't need to describe your payload and query params explicitly (which was required previously).

| improve this answer | |
6

Take a look at Kong.

Besides being open-source, you can operate it using its internal RESTful API, and you can extend it with custom plugins.

| improve this answer | |
2

Just to add to @EdwardSamuel's answer:

Yes, the there is, and the proper AWS service for this is Application Load Balancer.

However, I'm really curious if @EdwardSamuel's answer really works because I'm also interested in using API Gateway for this purpose. I'm aware of some limitations with API Gateway (content-length limit, etc.) but I'm not sure yet whether these limitations will make it unusable to, say, reverse proxy a WordPress blog.

| improve this answer | |
  • 1
    ALB supports path based routing. BUT doesn't reverse proxy. – Edward Olamisan Mar 3 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.