how to make AWS api gateway accept http instead of https

后端 未结 4 2024
醉话见心
醉话见心 2021-02-05 06:35

I have a Lambda function proxied by API Gateway. However, API Gateway only expose https and not http. I searched everywhere but looks like API Gateway is not po

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 07:01

    CloudFront is a quick solution as it's much easier to set up compared to instantiating an Elastic Beanstalk.

    I have spent couple of hours trying to get this right, so just to share some good write-ups and one more gentle reminder:

    1. This Smartcam project utilize Amazon API Gateway and CloudFront, it describes the setup procedure in details.
    2. The official example given in Amazon's doc demonstrates how to create GET and POST method with query string parameters (e.g. /search?keyword=mars&...), JSON payload and plus path parameters. Must read!
    3. Personal 2 cents:
      • if you are using query string parameters, make sure to edit behavior and then choose forward all, cache all under Query String Forwarding and Caching.
      • Alternatively, read this doc for another two possible configurations.
      • If you already set the Origin Path to your stage variable (by default: /prod), then when you invoke your CloudFront domain, skip the /prod, simply: xxxx.cloudfront.net/resource1/resource2?param1=...¶m2=...

提交回复
热议问题