3

I'm trying to build a serverless app with AWS. My API is working fine, but my custom domain is not. I'm receiving a 403 forbidden answer. This is how it's configured my custom domain:

enter image description here

And then I'm using the Target URL provided by this Custom Domain in Route 53 as CNAME. How can I fix this?

Reza Mousavi
  • 4,420
  • 5
  • 31
  • 48
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174

1 Answers1

4

The CNAME should point to the CloudFront endpoint (*.cloudfront.net) rather than the API Gateway endpoint (*.execute-api.[region].amazonaws.com).

The CloudFront endpoint can be found by going to API Gateway -> Custom Domain Names. A CloudFront domain should be listed under "Target Domain Name".

Tom
  • 1,660
  • 8
  • 16
  • 9
    That is the case for _Edge Optimized_ endpoints. I'm wondering if there is a way to set up this with _Regional_ ones (*.execute-api.[region].amazonaws.com). – Dmitry Kolomiets Mar 20 '19 at 06:37
  • I'm also facing same issue but i don't see any Target domain name. I'm having regional endpoint. – uni Dec 15 '21 at 12:06