I was able to create fallowing environment:
Domain: example.com
Three buckets: www.example.com
, example-en
and example-ar
. All three publicly accessible for read;
www.example.com
contains index.html
file in the main directory
example-en
contains index.html
file in the /en/ directory
example-ar
contains index.html
file in the /ar/ directory
Each bucket required setting up index page to work:
gsutil web set -m index.html gs://www.example.com/
Setting website configuration on gs://www.example.com/...
gsutil web set -m index.html gs://example.en/
Setting website configuration on gs://example.en/...
gsutil web set -m index.html gs://example.ar/
Setting website configuration on gs://example.ar/...
I configured HTTPTS load balancer (with GCP's managed SSL certificate) for example.com
and 'www.example.com`.
- Backend services & backend buckets contain three above buckets.
- Host and path rules are configured that:
You can redirect any path to any bucket you want, the only requirement is that the redirected path must match the path in the bucket (otherwise it won't work). You can also use subdomains and redirect them to other buckets. It's possible to add new services and paths to existing LB so you can make changes later on.
Let me know if this answers your question.
Last thing is setting up a front-end (one for port 80 and one for 443 with SSL encryption).
You can also have a look at the Path Matcher documentation which will give you some more ideas.