1

Under Load Balancer,

I have two domains www.xyz.com search.xyz.com

and on Google cloud (one of the VM), I have apache running on port 80, and nodejs running on 8080.

I want to create two backends to the same group with different ports (one of them to apache and on of them to nodejs),

if host name matches forward to different backend for eg. www.xyz.com should goto backend host port 80 search.xyz.com should goto backend host port 8080

I tried added backends in console, however it keeps overwriting other.

Murali K
  • 539
  • 5
  • 8
  • I have also created two load balancers, and when I select same backend (i created new but pointing to same target group as the other with a different port. it doesn't work – Murali K Jul 18 '17 at 20:52
  • how did you solve this issue?? I am also struggling the same – Tejas Oct 18 '17 at 09:14

1 Answers1

4

I had the same issue and solved it by using different port names for the service.

This issue is described in detail in the Load Balancer documentation, under Restrictions and guidance for instance groups:

If your instance group serves two or more ports for several backends respectively, you have to specify different port names in the instance group.

It's easy to overlook, but when you create a backend service, you're asked to name the port. The good news is that you can rename the port easily.

Mikey
  • 1,312
  • 10
  • 11