在AWS上添加SSL通信ELB EC2之间并迫使仅HTTPS交际 [英] Adding SSL communication between ELB EC2 on AWS and forcing only HTTPS comunication

查看:176
本文介绍了在AWS上添加SSL通信ELB EC2之间并迫使仅HTTPS交际的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加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 <一href="http://www.cognitiveoxygen.com/2012/11/installing-a-godaddy-ssl-certificate-on-an-aws-elb-amazon-elastic-load-balancer.cfm"相对=nofollow>指南。

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.

看看<一href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#x-forwarded-headers"相对=nofollow> ELB文档。

这篇关于在AWS上添加SSL通信ELB EC2之间并迫使仅HTTPS交际的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆