Pages

03 November, 2023

GCP static website hosting via bucket does not serve configured error and index pages

I'm trying to serve a simple static React SPA through GCP bucket as described here:
https://cloud.google.com/storage/docs/hosting-static-website />

It is crucial for my structure that for /my_directory, the file /my_directory/index.html is served.


I think what I want is exactly described here in the "Three-object bucket" in the documentation


This is my config:





This is my file structure:





In the folder test_2023_11_03_c there is a file "index.html"


But it doesn't work.


For



*
https://storage.googleapis.com/my-bucket-name, I expect to get the main index.html served. However, instead I get a list of all files in the bucket.

*
https://storage.googleapis.com/my-bucket-name/something-that-doesnt_exist, I expect the content of my_error.html to be served. However, instead I get NoSuchKeyThe specified key does not exist.No such object: my-bucket-name/something-that-doesnt_exist

*
https://storage.googleapis.com/my-bucket-name/test_2023_11_03_c, I expect the content of the directory's index.html to be served. However, instead I get the same error: NoSuchKeyThe specified key does not exist.No such object: my-bucket-name/test_2023_11_03_c






What am I doing wrong?

No comments:

Post a Comment

Thanks