Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
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)?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda