Reputation: 53
I'm trying to configure the Google Cloud loadbalancer to do the following:
I have a website running on a Wordpress machine in a VM instance which I want users to access when they enter outairnet.com
.
And I have a separate html file that I want users to access when they access outairnet.com/map
.
WP is running on a compute engine VM, connected to a VM instance and to a backend service. The seperate html file is on a service bucket, connected to a backend bucket.
I've triedd to configure a very simple path forwarding rule, which made sense to me. But it just adds up to anyone trying to access outairnet.com/*
gets to the WP (which is fine)
but accessing outairnet.com/map
doesn't point to the storage bucket with the html file, however accessing outairnet.com/index.html
does point to the separate html file.
My LB config looks like this.
I think I'm on to the problem but still can't solve it.
it looks like google console adds a /* rule even when I try to delete it.
so its a /* path rule that catches everything despite having a more specific rule like /mypath/* in addition.
but after removing it is just readded automatically for some reason. why?
Upvotes: 2
Views: 965
Reputation: 53
I just added another path rule with just "/" directing to the VM and it seemed to do it, but now the only glitch is www.outairnet.com/map is fine but outairnet.com/map without www directs to the vm and not the bucket
Upvotes: 0
Reputation: 4443
It's possible - there are a few steps involved such as creating a bucket with your static page, adding it as a backend service in your load balancer and creating a new path-rule in it to redirect the requests.
And now the details:
outairnet.com/mylink/
it will work regardless of the name used. I tested it.outairnet.com/mylink/
then directory's name has to be mylink
. Upload your files into that directory. Name your main index file index.html
unless you want to provide full file path./mylink/*
.) and select the bucket you've just created from the dropdown list.No changes necessary for the frontend. Save the changes and in a few moments it should be working.
Upvotes: 2