Is there a way to use NLB to load balance HTTP requests for PHP-FPM + NGINX?

Viewed 532

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?

2 Answers

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 --> ...

Related