问题描述
我想添加SSL支持我的网站是在AWS基础设施。
I am trying to add SSL support for my site which is on AWS infrastructure.
我使用(Ubuntu的,阿帕奇,蛋糕PHP)。
I am using (Ubuntu, Apache, cake-php).
我安装了去爸爸证书每本AWS ELB 指南。
I installed the certificate from go daddy on AWS ELB per this guide.
当我通过HTTPS它工作正常,但该网站也可通过HTTP测试我的域名。
When I test my domain via HTTPS it works fine, but the site is also available via HTTP.
我想重定向所有调用HTTP,但人均指导说明ELB和EC2通过HTTP进行通信,因此确定我的EC2的协议是80端口,所以EC2没有办法将用户重定向,因为从ELB所有的通信是通过端口80。
I would like to redirect all calls to HTTP, but per the guide instructions the ELB and EC2 communicate via HTTP, so the protocol identified by my EC2 is on port 80, so the EC2 has no way to redirect the user, because all communication to it from ELB is over port 80.
如果我改变ELB-EC2设置为HTTPS,它不工作了,我认为需要进行一些配置(在ELB,EC2?),但我无法找到上述的任何文档。
If I change ELB-EC2 settings to HTTPS, it does not work anymore, I assume some configuration is required (on ELB,EC2?) but I could not find any documentation on the above.
任何投入,链接等,将大大AP preciated!谢谢
Any input, links etc. would be greatly appreciated!Thanks
推荐答案
ELB集 X-转发,原
头,你可以用它来检测,如果原来的请求是HTTP和重定向到HTTPS呢。
ELB sets X-Forwarded-Proto
header, you can use it to detect if original request was to HTTP and redirect to HTTPS then.
看看 ELB文档。
这篇关于在AWS上添加SSL通信ELB EC2之间并迫使仅HTTPS交际的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!