您可以为Elastic Beanstalk的LoadBalancer / ReversProxy编写启动配置文件,以将其他端口转发到其EC2实例。Ben
Delarre的一个例子:
"Resources" : { "AWSEBLoadBalancerSecurityGroup": { "Type" : "AWS::EC2::SecurityGroup", "Properties" : { "GroupDescription" : "Enable 80 inbound and 8080 outbound", "VpcId": "vpc-un1que1d", "SecurityGroupIngress" : [ { "IpProtocol" : "tcp", "FromPort" : "80", "ToPort" : "80", "CidrIp" : "0.0.0.0/0" }], "SecurityGroupEgress": [ { "IpProtocol" : "tcp", "FromPort" : "8080", "ToPort" : "8080", "CidrIp" : "0.0.0.0/0" } ] } }, "AWSEBLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "Subnets": ["subnet-un1que1d2"], "Listeners" : [ { "LoadBalancerPort" : "80", "InstancePort" : "8080", "Protocol" : "HTTP" } ] } }}
参考:
- 定制AWS EB的ENV http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-resources.html
- http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/using-elb-listenerconfig-quickref.html
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)