1

I am looking at this guide for AWS API Gateway Stage Variables in HTTP Urls. It shows all the different ways we can set up different URLs for different stages, but there doesn't seem to be a way to provide the protocol as a stage variable (http:// vs https://). If I try to add it in the endpoint in AWS API Gateway it doesn't let me.

I saw this comment asking the same question, but for some reason there was no answer. I couldn't find anyone else trying to do the same thing anywhere else online, which is odd because I would assume a lot of people would have HTTP for their dev environment but HTTPS for their live environment.

Does anyone know how I can use different protocols (http vs https) for different stages in my API endpoint?

scorgn
  • 3,439
  • 2
  • 20
  • 23
  • Maybe this question can help you : https://stackoverflow.com/questions/43236152/how-to-make-aws-api-gateway-accept-http-instead-of-https. I like the `Cloudfront` answer. – BTL Jun 06 '19 at 19:47
  • I think that question is asking how to hit the AWS API Gateway using HTTP, but that's not what I am wanting to do. I am wanting to set the protocol for HTTP Endpoints (the endpoints that the API gateway will hit) with a protocol stage variable, so I can change it based on the stage. For example ${stageVariables.url} allows for a stage-based URL, but I need to define a static protocol (http/https). – scorgn Jun 06 '19 at 19:56
  • You would have to have 2 API gateways (one for http and one for https) and then something in front of them that handles the routing based on the stage parameter – Deiv Jun 06 '19 at 20:21

0 Answers0