0

我正在使用此 CloudFormation 模板https://github.com/widdix/aws-cf-templates/blob/master/jenkins/jenkins2-ha-agents.yaml来设置 jenkins 服务器。

我现在想向 ELB 添加 SSL,并将https://github.com/widdix/aws-cf-templates/blob/master/jenkins/jenkins2-ha-agents.yaml#L511-L519修改为以下内容:

  MasterELBListener:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties:
      DefaultActions:
        - Type: "redirect"
          RedirectConfig:
            Protocol: "HTTPS"
            Port: "443"
            Host: "#{host}"
            Path: "/#{path}"
            Query: "#{query}"
            StatusCode: "HTTP_301"
      LoadBalancerArn: !Ref MasterELB
      Port: 80
      Protocol: HTTP

  MasterHTTPSListener:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties:
      Certificates:
        # - CertificateArn: !Ref CertificateARN
        - CertificateArn: !FindInMap
            - SSLmapping
            - ssl1
            - !FindInMap
              - AWSRegionsNameMapping
              - !Ref 'AWS::Region'
              - RegionName
      DefaultActions:
      - Type: forward
        TargetGroupArn: !Ref MasterELBTargetGroup
      LoadBalancerArn: !Ref MasterELB
      Port: 443
      Protocol: HTTPS

但是当我尝试访问该站点时,它只是时间。

非常感谢任何建议

4

1 回答 1

0

好的,我需要从 ELB 打开对 433 的访问,其中:

  MasterELBHTTPSSGInWorld:
    Type: 'AWS::EC2::SecurityGroupIngress'
    Condition: HasNotAuthProxySecurityGroup
    Properties:
      GroupId: !Ref MasterELBSG
      IpProtocol: tcp
      FromPort: 443
      ToPort: 443
      CidrIp: '0.0.0.0/0'
于 2019-09-04T09:04:12.283 回答