I have two VMs running HTTP servers on port 8545 as shown in the figure and placed in an instance group.
I created a HTTP load balancer in GCP to balance HTTP requests from end users. However, with the setup shown in the figure and the firewall rules, the health checks fail and I also can't access http://35.190.34.26:80/
Error: Server Error
The server encountered a temporary error and could not complete your request.
Please try again in 30 seconds.
However, if I add a firewall rule, which allows everything (0.0.0.0/0 on 8545)
, the health checks pass and I can also access http://35.190.34.26:80/
But, I don't want to write this firewall rule which allows everyone on 8545. What is the correct way to configure the firewall so that only the load balancer can access the instance group on this port?