在Azure容器服务中启用SSL端点

时间:2019-12-10 04:42:00

标签: azure containers

我一直试图将SSL终结点添加到我在Azure容器服务上托管的应用程序中。 我正在关注文章

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-container-group-ssl#create-a-self-signed-certificate

本文适用于端口80上托管的应用程序。 文章说仅打开端口443,但在这种情况下我的应用程序无法运行(我的应用程序托管在8000上)。 当我打开8000时,没有添加SSL端点。

我的Deployment.yaml文件是

api-version: 2018-10-01 location: eastus name: starter properties:   containers:
  - name: nginx-with-ssl
    properties:
      image: nginx
      ports:
      - port: 443
        protocol: TCP
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 1.5
      volumeMounts:
      - name: nginx-config
        mountPath: /etc/nginx
  - name: xxx
    properties:
      environmentVariables:
      image: xxx
      ports:
      - port: 8000
        protocol: TCP
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 4  
   volumes:
  - secret:
      ssl.crt: xxx
      ssl.key: xxx
      nginx.conf: xxx
    name: nginx-config   imageRegistryCredentials:
  - server: xxx
    username: xxx
    password: xxx   ipAddress:
    ports:
    - port: 443
      protocol: TCP
    dnsNameLabel: xxx
    type: Public  
    osType: Linux tags: null
  type: Microsoft.ContainerInstance/containerGroups

我在这里做错了什么?

1 个答案:

答案 0 :(得分:0)

您应该配置nginx来进行代理和配置ssl \ redirection等。this part对此进行了详细介绍。但是原则上,这是应该使用nginx(在nginx配置文件中)而不是ACI进行的。

最好在服务器故障时询问nxing配置问题。