Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate whether it's possible to create redirects on S3 #97

Closed
chrisroos opened this issue Jul 31, 2017 · 4 comments
Closed

Investigate whether it's possible to create redirects on S3 #97

chrisroos opened this issue Jul 31, 2017 · 4 comments

Comments

@chrisroos
Copy link
Contributor

We're hoping to redirect from the Asset Manager to a public asset on S3. If an asset is updated then we think we'll want to add a redirect from the old to new URLs.

@chrisroos chrisroos modified the milestone: Serve assets directly from S3 Jul 31, 2017
@floehopper floehopper self-assigned this Aug 2, 2017
@floehopper
Copy link
Contributor

It is possible to get an S3 object URL to respond with a 301 (temporary) redirect by setting the x-amz-website-redirect-location property in the object's metadata. You can redirect to another object in the bucket by setting this property to the new object key, or you can redirect to an arbitrary URL by setting the property to the new URL. See the "Configuring a Webpage Redirect" documentation.

@floehopper
Copy link
Contributor

If you configure an S3 bucket for "static website hosting" then you can setup more sophisticated routing rules, but I think that means we'd have to have an index page, so it's probably not going to be what we want.

@floehopper
Copy link
Contributor

It is possible to get an S3 object URL to respond with a 301 (temporary) redirect by setting the x-amz-website-redirect-location property in the object's metadata. You can redirect to another object in the bucket by setting this property to the new object key, or you can redirect to an arbitrary URL by setting the property to the new URL. See the "Configuring a Webpage Redirect" documentation.

I've just been trying out the "301 redirect" mechanism and it seems to only work if you enable "static website hosting" for the S3 bucket which I'm not sure we want to do.

@floehopper
Copy link
Contributor

I think these investigation tasks are "done", although we will need to decide how/whether we're going to handle updating assets. I plan to create a new issue or two to capture that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants