Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
AWS S3 public bucket hosting static webpage behind a proxy

I’m trying to access some webpages available using S3, and it works fine using an url like the following: http://my-crazy-bucket.s3-website-us-east-1.amazonaws.com

Thing is.. I need to hide those page's url behind an javascript written proxy application, using express. I was able to do this before using elastic beanstalk instead of S3. But when I tried migrating those static pages from EB to S3, and accessed it using the proxy url for that given s3 bucket. This resulted in the following error:

404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: my-proxy-url.com
RequestId: some stuff...
HostId:  some more stuff...

I was hoping to see my-crazy-bucket instead of my-proxy-url.com in the BucketName of this error.

I did configured the CORS as permissive in the bucket configuration like this:

<CORSConfiguration>
 <CORSRule>
   <AllowedOrigin>https://my-proxy-url.com</AllowedOrigin>
   <AllowedMethod>GET</AllowedMethod>
   <MaxAgeSeconds>3000</MaxAgeSeconds>
   <AllowedHeader>Authorization</AllowedHeader>
 </CORSRule>
</CORSConfiguration>

But still the problem persists.

Do you guys think I need any additional S3 configuration or the problem is in my proxy (even though it worked before pointing to the same static pages hosted in the old elastic beanstalk instances)?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Not a CORS issue.

You have to change (rewrite) the HTTP Host: header of the incoming request, inside the proxy, before sending the outbound request, so that S3 understands that the bucket in question is my-crazy-bucket.s3-website-us-east-1.amazonaws.com.

It's not enough just to send the request to S3. It needs to be addressed to the correct bucket, and S3 determines which bucket that is, by looking at the incoming Host: header for a bucket endpoint or a bucket name.

Without seeing your proxying code, I can't be more specific.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!