2

So far, I have been using PHP-FPM + Nginx on ECS with Application Load Balancer, and it's working. The problem is using ALB we cannot use static IP address, this problem is solved if I use NLB instead of ALB.

But it seems NLB only use TCP protocol, and cannot load balance HTTP protocol. Is there a solution for this?

Yosi Pramajaya
  • 3,895
  • 2
  • 12
  • 34

2 Answers2

3

ALB we cannot use static IP address

If you want static public IP for your ALB, you can enable AWS Global Accelerator:

Using an accelerator provides static IP addresses and improves the availability and performance of your applications.

ALB supports the accelerator:

Marcin
  • 215,873
  • 14
  • 235
  • 294
2

NLB is low level and does not know you are balancing HTTP when a request arrives : From NLB point of view it is just a TCP request. One solution is to use another ALB after your NLB if you can't do the redirection in nginx. So the flow of the request will be :

Your User ---> NLB ---> ALB --> ...

Maestro
  • 41
  • 2
  • This is good idea. I thought about it as well, but using NLB between Users and ALB somehow blow up (increased from 5 each minute to 1000) the number of new connection for ALB. I guess this is because of the health check from NLB which cannot be disabled. – Yosi Pramajaya Oct 01 '20 at 09:39
  • Yes your Guess is right It is because of HealthCheck @see https://stackoverflow.com/questions/48135471/nlb-target-group-health-checks-are-out-of-control – Maestro Oct 01 '20 at 16:50