首页 > 解决方案 > 在 Azure 容器服务中启用 SSL 端点

问题描述

我一直在尝试将 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

我在这里做错了什么?

标签: azurecontainers

解决方案


您应该配置 nginx 来执行代理和配置 ssl\redirection 等。这部分详细介绍了这一点。但原则上这是你应该用 nginx(在你的 nginx 配置文件中)做的事情,而不是用 ACI。

您最好询问有关服务器故障的 nxing 配置问题。


推荐阅读