How to connect cloudfront and alb?

How to connect cloudfront and alb?

I am trying to connect to ec2 through ALB through Cloudfront.

Currently, the ALB already has one listener associated with cloudfront.

So I set a listener with a different port as the origin and set the path to the behavior.

However, when connecting to the distribution domain, a 404 error occurred in the previously connected domain.

origin setting

behavior setting

Looking at the cloudfront docs, I could find something related to secure connection via headers, but I just want to connect without header security.

It seems that ALB and Cloudfront are not connected, seeing as the connection through ALB DNS works well. What should I do?

답변1

It was a matter of order of behavior.

If you set the priority higher than the root domain.

This solves the problem because behavior has a higher priority.

관련 정보