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

130
Visualizações
AWS cloudfront route root to EC2 route anything else to S3

We have an angular app living in S3 we would like our domain to serve when there is anything after the / but a flat html page and basic assets to be served from an EC2 when the root of the domain is accessed.

So far we have not gotten anything to work and we're really hoping we can make something work.

So far in cloudfront we have try to make the default route to an EC2 origin and /* and event / route to an S3 origin but nothing seems to be working.

How can we get our domatin example.com serve our EC2 files but anything other than the root, ie. example.com/one, example.com/two, etc. route to the S3 single page app

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

0

So far in cloudfront we have try to make the default route to an EC2 origin and /* and event / route to an S3 origin but nothing seems to be working.

If I understand what you're trying to do, that's sort of backwards. * matches everything, including nothing, and including more slashes.

Create a new cache behavior matching the path / and pointing to EC2 origin. This catches the main page.

Create a new cache behavior matching the path /*/* pointing to the EC2 origin. This catches anything in a folder, e.g. /pics/cats.jpg and /pics/cats/funny.jpg and /pics/cats/hilarious/lol.jpg.

If there are any files (other than the main page) in the root of the web server in EC2, create a new cache behavior matching the path /*.* pointing to the EC2 origin. This catches files in the root directory, e.g. /cat.jpg.

Point the default cache behavior to S3. Everything already matched by the two or three other behaviors goes to EC2, and what's left over goes to the bucket, which would be / followed by any characters excluding another / or ., which would have been captured by one of the behaviors routing to EC2.

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