简体   繁体   English

AWS ELB 和管理证书。 HTTPS call 添加域名到API URL call

[英]AWS ELB and managing certificates. HTTPS call add domain name to API URL call

some background.一些背景。

Front end(REACTJS) hosted on HostGator.前端 (REACTJS) 托管在 HostGator 上。 I have a purchased domain name (domain.com) Code holds api url for its GET PUT and so on of ELB("https://name-id.area.elb.amazonaws.com/")我有一个购买的域名 (domain.com) 代码为 api url 的 GET PUT 等等 ELB("https://name-id.area.elb.amazonaws.com/")

Back end hosted on Elastic Beanstalk (war file - tomcat) has a load balancer with two listeners http and https which has the certificate of my domain which I verified by email.托管在 Elastic Beanstalk 上的后端(war 文件 - tomcat)有一个负载均衡器,带有两个侦听器 http 和 https,它具有我通过 email 验证的域证书。

calling the api with http :name-id.area.elb.amazonaws.com/.使用 http 调用api :name-id.area.elb.amazonaws.com/。 causes no issue and will direct to the real api and return me the results.不会造成任何问题,并将直接转到真实的 api 并将结果返回给我。

however if I make a call using https of the same url it fails.但是,如果我使用相同的url的 https 进行呼叫,则会失败。 The api call becomes https:domain.com/name-id.area.elb.amazonaws.com/bla/bla/params which does not exist. api 呼叫变为 https:domain.com/name-id.area.elb.amazonaws.com/bla/bla/params 不存在。

I have no idea how to fix this.我不知道如何解决这个问题。 All this to make my website work with SSL.所有这些都是为了使我的网站与 SSL 兼容。

As you have mentioned that you have created two listener to your ELB http and https respectively.正如您所提到的,您已经分别为 ELB http 和 https 创建了两个侦听器。 http request works fine. http 请求工作正常。

Make sure your listener are associated to the target group which are able to handle https request.确保您的侦听器与能够处理 https 请求的目标组相关联。

your target group should have at least one instance which will handle https request.您的目标组应该至少有一个实例可以处理 https 请求。 you can do it while creating the target group.您可以在创建目标组时执行此操作。 Hope this was helpful and you could narrow it down.希望这对您有所帮助,您可以缩小范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM