4

I need to implement a reverse proxy/redirect service for site which will be hosted in AWS S3 (static JS assets) + CloudFront and multiple backends running as different tasks AWS ECS available at domain.com/api/session_number Redirect or reverse proxy service should analyze input parameter and redirect to corresponding backend.

So far I've found ECS-nginx-proxy but it looks more like the tool for dev/stage environments. How such service can be implemented for production using AWS services like ALB + API Gateway, Lambda@Edge?

enter image description here

mva
  • 384
  • 1
  • 5
  • 12

2 Answers2

2

Instead of nginx, what you really want to put there is the Traefik Load Balancer:

  1. How should I setup Traefik on ECS?
  2. https://netbears.com/blog/traefik-cluster-ecs/
shariqmaws
  • 8,152
  • 1
  • 16
  • 35
  • thank you for suggestion @shariqmaws, my initial idea was to run dynamic backends as one-off tasks, and as far as I understood, I should create new task definition, with corresponding docker labels for traefik. But I want to use one task definition and change only env vars, is it possible? – mva Apr 01 '20 at 07:50
0

we've implemented a temporary solution with Traefik 1.7 and provisioning frontend/backend configuration using Traefik REST API

so basically on each configuration change, there is a Traefik config update with POST call to api/providers/rest

such solution lacks HA support and on Traefik restart it's REST config is empty should be replaced with ALB-based solution probably

mva
  • 384
  • 1
  • 5
  • 12