- 최신
- 최다 투표
- 가장 많은 댓글
Hello,
Kindly note, CloudFront will by default forward the path present in client request to the Origin server. In your case, the request path would be forwarded to the ALB origin. Now, further traffic flow should depend on the rules configured on ALB. If you wish to direct the traffic to a separate Target Group with desired EC2 instances and port, you can create a rule based on path for this forwarding. Your EC2 server application needs to process this request and provide the required response.
Using the optional path parameter in Origin settings of CloudFront ensures that every request forwarded from CloudFront to this Origin will by default have this path appended with the Origin domain followed by the client request path. Note:-
- Client --> CloudFront request needs to be on port 80 and 443 for HTTP and HTTPS respectively, this cannot be customised
- Origin domain path should not contain the port number for HTTP or HTTPS (it will be considered as part of path pattern itself), there is a separate option for providing the ports you wish for CloudFront to connect on with the Origin ALB for HTTP and HTTPS.
- ALB Origin needs to configure listeners on same port where requests are being forwarded from CloudFront
- Rules should be created in ALB to handle incoming traffic from CloudFront to direct to the desired Target Group which will have details for the instances and ports serving the traffic
If you wish to modify the client request being forwarded from CloudFront to Origin for different paths, you can create separate Cache behaviours in CloudFront and use features like Lambda@Edge or CloudFront Functions.
Default Root object of CloudFront is used to fetch a resource from Origin when Client request does not include any path or resource.
When an error is encountered in your setup, to narrow down the scope of troubleshooting, you can try requesting the same resource via ALB directly.
To get better resource-specific troubleshooting assistance for any service in your setup, you can also consider creating a support case with the respective Support team of AWS using the link: https://console.aws.amazon.com/support/home#/case/create
You can refer this documentation for more information about creating support cases and case management: https://docs.aws.amazon.com/awssupport/latest/user/case-management.html
관련 콘텐츠
- AWS 공식업데이트됨 2년 전