[aws-cloudfront] cloudfront won't forward request to custom domain HTTP API.
See original GitHub issue❓ General Issue
The Question
I am serving static website with S3/Cloudfront at /
and I have set custom domain HTTP API at /api/*
as per CDK documentation on apigatewayv2 but cloudfront won’t forward request to HTTP API. Cloudfront will serve 404 not found to any /api/*
path.
Environment
- CDK CLI Version:
- Module Version:
- Node.js Version:
- OS:
- Language (Version):
Other information
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Set up API Gateway with a custom CloudFront distribution
I want an edge-optimized API endpoint in Amazon API Gateway, but I need more control over the Amazon CloudFront distribution.
Read more >How to forward cloudfront to HTTP API with custom domain
Basically Cloudfront is not forwarding my /api/* request to the HTTP API. Here is my cloudfront CDK code const distribution = new ...
Read more >CloudFront wrapped API Gateway but don't pass HOST Header?
tl/dr: Origin Request Policy ALL_VIEWER on CloudFront lets Header Host ... Custom Domains on API Gateway won't solve the problem (HOST still ...
Read more >Prevent requests from accessing API directly
With Amazon CloudFront, you can also enforce encrypted end-to-end ... 3.2 Add custom HTTP headers to the requests. ... Section3 CloudFront Domain Name....
Read more >Customize your Portal's domain with CloudFront and Route53
To configure your Portal to make it work on SSL you can use AWS Cloudfront which is a CDN that allows you to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Solved! For anyone else looking for the solution:
This is still an issue. What’s the proper way to set up an HTTP origin in CDK? @rix0rrr @njlynch
I see in a post above, you said to use the API endpoint, but that doesn’t work either:
The end goal is to set up a CF distribution with a CNAME alias (like api.mydomain.net) and have the origin be a “raw” HTTP API endpoint (*.execute-api.us-east-1.amazonaws.com).