GCE Load Balancer HTTPS and HTTP IP

痴心易碎 提交于 2019-12-02 04:33:49

问题


I've setup an application (Django and nginx) at GCE with an HTTP Load Balancing.

I created 2 global forwarding rule. 1 for HTTP and the other for HTTPS. This gave me 2 ip.

  • https: 130.211.11.247:443
  • http: 130.211.15.15

I added the HTTPS IP (130.211.11.247) in my DNS A Record for my domain dvotedfan.com and that works perfectly if I access https://dvotedfan.com

My problem is that it wont work if I try http://dvotedfan.com (Error 404). If I use the IP provided by the HTTP IP at 130.211.15.15 will it work.

Since I know I can't add more then 1 IP for a DNS A Record how do I make the http://dvotefan.com requests work.


回答1:


You should use the same IP for both forwarding rules (http and https) like in this example:

By doing so, you can have a single DNS A record pointing to your application/website for http and https traffic.

Just make sure, you have created a static IP before you create/edit forwarding rules in your load balancer.



来源:https://stackoverflow.com/questions/36295056/gce-load-balancer-https-and-http-ip

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