How to CNAME to Amazon API Gateway Endpoint

前端 未结 4 662
太阳男子
太阳男子 2020-12-23 16:38

I\'m trying to set a CNAME on Cloudflare to point to an Amazon API Gateway endpoint. The CNAME is for use when referring to one of my subdomains. The gateway in turn points

4条回答
  •  猫巷女王i
    2020-12-23 17:18

    Set up Amazon's API Gateway Custom Domain with CloudFlare

    1. In your AWS management console go to the API Gateway service and select Custom Domain Names from the left menu.

    2. Click the Create button.

    3. Log into CloudFlare, select your domain and open the Crypto tab

    4. Go to SSL and set your SSL mode to "Full (Strict)" to avoid a redirect loop.

    5. Go to Origin Certificates and click Create Certificate

    6. Let CloudFlare generate a private key and a CSR and choose RSA as the private key type

    7. Make sure that the hostname for your custom API domain is covered. (e.g. api.mydomain.com. You can specifically configure this custom domain or use a wildcard such as *.mydomain.com as is configured by default.

    8. Pick PEM as the key format which is selected by default.

    9. In AWS switch to region US-EAST-1 and goto the Certificate Manager.

    10. Click Import a Certificate.

    11. Copy the certificate body from your CloudFlare certificate to Certificate body to the configuration of the custom domain in the AWS Management Console.

    12. Copy the Private key to the certificate private key field in the console

    13. In the certificate chain copy the Cloudflare Origin CA - RSA Root which can be found here.

    14. Enter your custom domain name in the AWS console and a name for your certificate

    15. Now the custom domain name will be created in AWS CloudFront. It can take up to an hour before the domain becomes active.

    16. The next thing you need to do is set up the mappings of the custom domain in the AWS Console.

    17. The final step is to create a new CNAME Record in CloudFlare to link your domain to the CloudFront url. When you open the settings page of your custom domain in the AWS console copy the Distribution domain name. This is the domain you need to use when creating the new CNAME Record.

    Source

提交回复
热议问题