s3website 404 behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

After setting up ceph.conf values resembling:

rgw dns name = myhost.domain.com (eg)
rgw enable static website = true
rgw dns s3website name = mywebsite.domain.com

and creating buckets and objects with `public-read` canned acls, via the
following code (assume conn is s3connection object returned by boto):

website_bucket = conn.create_bucket("s3website",policy='public-read')
index_key = website_bucket.new_key('index.html')
index_key.content_type = 'text/html'
index_key.set_contents_from_filename('index.html',policy='public-read')

error_key = website_bucket.new_key('error.html')
error_key.content_type = 'text/html'
error_key.set_contents_from_filename('error.html',policy='public-read')

foo_key = website_bucket.new_key('foo.html')
foo_key.content_type = 'text/html'
foo_key.set_contents_from_filename('foo.html',policy='public-read')

website_bucket.configure_website('index.html','error.html')
website_bucket.get_website_configuration()
# returns
# {'WebsiteConfiguration': {'ErrorDocument': {'Key': 'error.html'}, 'IndexDocument': {'Suffix': 'index.html'}}}


Calling urls like s3website.mywebsite.domain.com works as
expected, links from index page are processed correctly, and accessing
something like s3website.<website-domain>/foo.html also works as
expected.

However the behaviour when a 404 is encountered in the bucket
seems erratic, for eg accessing:
s3website.mywebsite.domain.com/nonexistant.html

the browser sees a 200 OK and just does a download of an empty file, rgw
actually returns a 404 here[1]. I haven't checked the behavior on S3
yet, Is there something else that needs to be set in bucket website
configuration, or is this something RGW is doing wrong at the moment?

[1]: https://gist.github.com/theanalyst/891781582ddc454bafdc5ef7d075ec7a

--
Abhishek Lekshmanan
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux