All of lore.kernel.org
 help / color / mirror / Atom feed
* s3website 404 behaviour
@ 2016-05-02 13:53 Abhishek Lekshmanan
  2016-05-02 17:48 ` Robin H. Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Abhishek Lekshmanan @ 2016-05-02 13:53 UTC (permalink / raw)
  To: ceph-devel@vger.kernel.org; +Cc: robbat2

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: s3website 404 behaviour
  2016-05-02 13:53 s3website 404 behaviour Abhishek Lekshmanan
@ 2016-05-02 17:48 ` Robin H. Johnson
  2016-05-02 20:12   ` Abhishek L
  0 siblings, 1 reply; 3+ messages in thread
From: Robin H. Johnson @ 2016-05-02 17:48 UTC (permalink / raw)
  To: Abhishek Lekshmanan; +Cc: ceph-devel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

(I'm on the list, no need to mail me directly).

On Mon, May 02, 2016 at 03:53:09PM +0200, Abhishek Lekshmanan wrote:
> 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
What commits are you using?
You'll need both PR8633 and PR8669 present.

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead, Foundation Trustee
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 445 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: s3website 404 behaviour
  2016-05-02 17:48 ` Robin H. Johnson
@ 2016-05-02 20:12   ` Abhishek L
  0 siblings, 0 replies; 3+ messages in thread
From: Abhishek L @ 2016-05-02 20:12 UTC (permalink / raw)
  To: ceph-devel


Robin H. Johnson writes:

> (I'm on the list, no need to mail me directly).
>
> On Mon, May 02, 2016 at 03:53:09PM +0200, Abhishek Lekshmanan wrote:
>> 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
> What commits are you using?
> You'll need both PR8633 and PR8669 present.
(already mentioned in irc, mentioning here for completeness)

Both of these PRs weren't yet there in the RGW I was using, I'll apply
these and see how the behaviour is.

Thanks 
Abhishek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-02 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02 13:53 s3website 404 behaviour Abhishek Lekshmanan
2016-05-02 17:48 ` Robin H. Johnson
2016-05-02 20:12   ` Abhishek L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.