Google cloud load balancer port 80, to VM instances serving port 9000

被刻印的时光 ゝ 提交于 2019-12-05 21:24:00

It isn't possible in GCE to do a port rewriting. As a workaround I use port forwarding using iptables Then in GCE, you can create a health check on port 9000, your target pool will have your instances listing on port 9000 and your forwarding rule will be on port 80 with your target pool.

Another workaround will be to run HAProxy on the instance to locally forward port 80 on the instance to port 9000.

If your app is HTTP-based (looks like it), then please have a look at the new HTTP load balancing announced in June. It can take incoming traffic at port 80 and forward to a user-specified port (eg. port 9000) on the backend. The doc link for the command is here:

https://developers.google.com/compute/docs/load-balancing/http/backend-service#creating_a_backend_service

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!