简体   繁体   English

EC2负载均衡器实例协议和端口

[英]EC2 Load Balancer Instance Protocol and Port

I have an elastic load balancer that works properly when configured like so: 我有一个弹性负载平衡器,按以下方式配置时可以正常工作:

Load Balancer Protocol: HTTPS
Load Balancer Port: 443
Instance Protocol: HTTP
Instance Port: 80

However, if I attempt to change the instance protocol to HTTPS and instance port to 443, my server stops responding. 但是,如果我尝试将实例协议更改为HTTPS,并将实例端口更改为443,则服务器将停止响应。

What do I have to do in order for my instance port to be 443? 为了使实例端口为443,我该怎么办?

The reason I want my instance port to be 443 is that my Rails app must verify that the incoming connection uses SSL, but this way, this check fails. 我希望实例端口为443的原因是我的Rails应用程序必须验证传入连接是否使用SSL,但是这样,此检查将失败。

You need to change the way your application detects whether or not the client is using SSL. 您需要更改应用程序检测客户端是否正在使用SSL的方式。

The port on the server won't give you that information. 服务器上的端口不会为您提供该信息。 You may want to look at the ELB documentation and see if you can use X-Forwarded-Proto or X-Forwarded-Port. 您可能需要查看ELB文档,并查看是否可以使用X-Forwarded-Proto或X-Forwarded-Port。

Your instance server has to be able to respond on port 443, with a valid HTTPS response. 您的实例服务器必须能够在端口443上以有效的HTTPS响应进行响应。

That generally means you have to install a signed SSL cert and configure your web server to use it. 通常,这意味着您必须安装签名的SSL证书并配置Web服务器才能使用它。

Without knowing what web server you are using, I can't give specific instructions. 不知道您使用的是哪种Web服务器,我无法给出具体说明。

For instance, if you are using Apache, you need to install something like mod_ssl. 例如,如果您使用的是Apache,则需要安装类似mod_ssl的文件。

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

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