Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make AWS api gateway accept http instead of https

Tags:

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 possible to accept http.

So my question is how to translate http client calls to https and send to api gateway? I am asking because my client can only make http calls and they won't change.

like image 497
Frank Luo Avatar asked Apr 05 '17 15:04

Frank Luo


People also ask

Does API gateway allow HTTP?

You can integrate an API method with an HTTP endpoint using the HTTP proxy integration or the HTTP custom integration. API Gateway supports the following endpoint ports: 80, 443 and 1024-65535. With proxy integration, setup is simple.

Does AWS gateway support HTTP?

Amazon API Gateway does not support unencrypted (HTTP) endpoints. By default, Amazon API Gateway assigns an internal domain to the API that automatically uses the Amazon API Gateway certificate. When configuring your APIs to run under a custom domain name, you can provide your own certificate for the domain.

Does AWS gateway support HTTP 2?

As far as I know, AWS API gateway supports HTTP/2 (verified with https://tools.keycdn.com/http2-test).


1 Answers

You can put a Cloudfront distribution in front of API Gateway with to following setup:

  • Origin Protocol Policy: HTTPS Only
  • Viewer Protocol Policy: HTTP and HTTPS
  • Forward Headers: None
  • Object Caching: Use Origin Cache Headers
like image 87
Florent B. Avatar answered Oct 02 '22 00:10

Florent B.