# Have an endpoint use http rather than https

**URL:** <https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515>\
**Category:** Serverless Framework\
**Created:** [January 16, 2018, 9:39am UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515 "2018-01-16T09:39:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gap](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gap](https://forum.serverless.com/u/gap)\
**Post date:** [January 16, 2018, 9:39am UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515/1 "2018-01-16T09:39:38Z")

</div>

I am rewriting an application using serverless. For legacy reasons I need to access an endpoint using http rather than https. Right now when I try to use http I get a redirect to https rather than the data I need. How I can setup an http endpiont rather than an https one?

Currently tis is the response I get with http

```auto
http get http://9lu88q2p7i.execute-api.us-east-1.amazonaws.com/staging/test
HTTP/1.1 301 Moved Permanently
Connection: keep-alive
Content-Length: 183
Content-Type: text/html
Date: Tue, 16 Jan 2018 09:31:51 GMT
Location: https://9lu88q2p7i.execute-api.us-east-1.amazonaws.com/staging/test
Server: CloudFront
Via: 1.1 861b49a34b383ce3ac4ea8b7117b8953.cloudfront.net (CloudFront)
X-Amz-Cf-Id: ChUFZEU_3HnRNB-dTYvZPtly0QiPgppSFE1t5BaJ5YIiNwc1IC2CZg==
X-Cache: Redirect from cloudfront

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>CloudFront</center>
</body>
</html>

```

I want it to look like this https response

```auto
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 4
Content-Type: application/json
Date: Tue, 16 Jan 2018 09:38:17 GMT
Via: 1.1 b790a9f06b09414fec5d8b87e81d4b7f.cloudfront.net (CloudFront)
X-Amz-Cf-Id: CjdFFBHTBTROgY_-c08vgTmPOIo2Jj5QPF6ihKHNkKB8on8q5YUIVA==
X-Amzn-Trace-Id: sampled=0;root=1-5a5dc809-33b5ff3672e71b5c73dd3bfb
X-Cache: Miss from cloudfront
x-amzn-RequestId: fb4d54ce-faa0-11e7-bc24-b37f137d756a

data

```

---

<div class="post-metadata">

**Author:** ![bill](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bill/32/1072_2.png) [@bill](https://forum.serverless.com/u/bill)\
**Post date:** [January 16, 2018, 11:56am UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515/2 "2018-01-16T11:56:44Z")

</div>

[https://aws.amazon.com/api-gateway/faqs/](https://aws.amazon.com/api-gateway/faqs/)

Q: Can I create HTTPS endpoints?

Yes, all of the APIs created with Amazon API Gateway expose HTTPS endpoints only. **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.

---

<div class="post-metadata">

**Author:** ![gap](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gap](https://forum.serverless.com/u/gap)\
**Post date:** [January 16, 2018, 12:31pm UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515/3 "2018-01-16T12:31:48Z")

</div>

Thanks Bill. It looks like AWS does not support what I need. I will have to figure out a workaround for this ☹ At least I can stop beating my head against a wall trying to make a round peg fit a square hole.

---

<div class="post-metadata">

**Author:** ![NachoColl](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/nachocoll/32/580_2.png) [@NachoColl](https://forum.serverless.com/u/NachoColl)\
**Post date:** [July 4, 2018, 5:39pm UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515/4 "2018-07-04T17:39:12Z")

</div>

Hi @gap, just having the same issue, did you solve it?

* * *

Ok, the solution is to use REGIONAL API GATEWAY, and manually create cloudfront that point to stage endpoints and allow HTTP at the cloudfront side 😉

---

<div class="post-metadata">

**Author:** ![adminy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/adminy/32/7762_2.png) [@adminy](https://forum.serverless.com/u/adminy)\
**Post date:** [September 2, 2024, 10:23am UTC](https://forum.serverless.com/t/have-an-endpoint-use-http-rather-than-https/3515/5 "2024-09-02T10:23:31Z")

</div>

I think the only reason people use the rest api gateway is to not have REGIONAL api gateway. Because they want to use the private version. Kind of defeats the purpose.
