3

Context

Web application with application server, i.e. Ruby on Rails with puma. Running within a container on AWS ECS with Fargate. Traffic is routed by AWS Application Load Balancer directly to application server running within container.

Question

Is reverse proxy still required between ALB and application itself, i.e. as sidecar container? What would be the benefit?

2
  • Why do you think a proxy is required between a load balancer and an application?
    – Tim
    Jan 16, 2020 at 18:46
  • I don't know, that's why I'm asking. So far in case of bare EC2s I always thought of it as a best practice. But now there's no clear consensus whenever to use it or not. i.e. across various examples from AWS on ECS you can find both, examples that use ALB directly connecting to app server, and examples that explain how to use reverse proxy. But there's no clear best practice whenever you need one or not. Jan 17, 2020 at 9:58

2 Answers 2

5
+50

A reverse proxy isn't required, but the web servers that ship with Rails have minimal functionality, so for any application that is public facing and can potentially grow, its a good idea to integrate a reverse proxy (eg Nginx) early on.

For example, this would give you advanced rate-limiting capability, caching and the ability to do end to end SSL termination with a lot less fuss that other web server implementations. Logging also becomes a lot easier, and stuff like TCP retries can be a life saver if your application is under load.

You don't need a sidecar. You can install Nginx on the same box as your application. Its super efficient and will not impact your application performance.

We use multiple Nginx proxies in front of Rails, and we serve billions of http requests per day.

Massive reverse proxying implementations such as Cloudflare are also built on Nginx.

1

A load balancer is a type of reverse proxy. Its benefits including accepting traffic on specific ports, acting as a type of firewall, and prevents some kinds of attacks reaching the server.

For the common case of a web app I can't see any significant benefit of having both a load balancer and a second reverse proxy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .