Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

Setting up a webpage on google cloud with https

I have bought a domain name on Google Domains, installed Wordpress Multisite on a Google Cloud VM with Compute Engine, setup a load balancer with 2 instances and an Active Google Managed certificate.

I have followed the instructions at https://cloud.google.com/load-balancing/docs/https/ext-https-lb-simple and pointed the Google DNS at the Load Balancer. I currenty get:

The website working in http (not secure) with the direct IP of the VM. The balancer switching between the two IPs if I enter the https address (ie returning Page served from: lb-backend-pubdeals-x06k) but not returning the wordpress site.

Address is https://pub.deals

But what I want is someone to type in http://pub.deals and https://pub.deals and get the secure site.

Does anyone have instructions on how to redirect users who arrive at http://pub.deals are then redirected to https://pub.deals?

Thanks Jay

question from:https://stackoverflow.com/questions/65864560/setting-up-a-webpage-on-google-cloud-with-https

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So John Hanley was right, I was over complicating things. For the last 20 years or so I've used hosting companies for my sites, and taken care of ssl when I needed to within wp-config and .htaccess, but this is my first time using google cloud and vm builds, so I followed their docs to apply a google managed ssl. They say in order to issue a google managed sll you need to have a load balancer set up, so I rtfm and set one up. It worked as far as the user was delivered to a secure site of either one of two instances, but I couldn't figure out how to attach them to my vm instance with wordpress on it and hence get my content displayed. I did get the http --> https forward using these docs (https://cloud.google.com/load-balancing/docs/https/setting-up-http-https-redirect) but I still didn't manage to connect the whole affair to the VM with wordpress on it.

TLDR; I deleted the load balancers and google certificate and did it through wordpress.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...