Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda