All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhishek Lekshmanan <abhishek@suse.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Cc: robbat2@gentoo.org
Subject: s3website 404 behaviour
Date: Mon, 02 May 2016 15:53:09 +0200	[thread overview]
Message-ID: <87eg9kva62.fsf@suse.com> (raw)

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

             reply	other threads:[~2016-05-02 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 13:53 Abhishek Lekshmanan [this message]
2016-05-02 17:48 ` s3website 404 behaviour Robin H. Johnson
2016-05-02 20:12   ` Abhishek L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg9kva62.fsf@suse.com \
    --to=abhishek@suse.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=robbat2@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.