0

I'm trying to make a private object on a static website hosted S3 bucket which is accessible from a signed URL. Seems simple enough, however using the following code with virtual_host enabled seems to always result in a 403 Forbidden. If I disable virtual_host then it works as expected.

url = Aws::S3::Presigner.new.presigned_url(
    :get_object,
    :bucket => BUCKET,
    :key => KEY,
    :virtual_host => true
)

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
resp = http.request(request)
puts resp.body

Is there a permissions/setting that is missing to make this work?

Braiam
  • 1
  • 11
  • 47
  • 78
Sean West
  • 1
  • 2

1 Answers1

0

These are the reasons

  1. Access Denied
  2. Account issue

enter image description here

Vishal G
  • 1,521
  • 11
  • 30