title: Accessing docker container over https on Azure subdomain
body: <p>As an experiment I'm trying to run a docker container on Azure using the Azure Container Service and Kubernetes as the orchestrator. I'm running the official nginx image. Here are the steps I am taking:</p>
  
  <p><code>
  az group create --name test-group --location westus
  az acs create --orchestrator-type=kubernetes --resource-group=test-group --name=k8s-cluster --generate-ssh-keys
  </code></p>
  
  <p>I created Kubernetes deployment and service files from a docker compose file using Kompose.</p>
  
  <p><strong>deployment file</strong>
  <code>
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    annotations:
      kompose.service.type: LoadBalancer
    creationTimestamp: null
    labels:
      io.kompose.service: test
    name: test
  spec:
    replicas: 1
    strategy: {}
    template:
      metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: test
      spec:
        containers:
        - image: nginx:latest
          name: test
          ports:
          - containerPort: 80
          resources: {}
        restartPolicy: Always
  status: {}
  </code></p>
  
  <p><strong>service file</strong>
  <code>
  apiVersion: v1
  kind: Service
  metadata:
    annotations:
      kompose.service.type: LoadBalancer
    creationTimestamp: null
    labels:
      io.kompose.service: test
    name: test
  spec:
    ports:
    - name: "80"
      port: 80
      targetPort: 80
    selector:
      io.kompose.service: test
    type: LoadBalancer
  status:
    loadBalancer: {}
  </code></p>
  
  <p>I can then start everything up:</p>
  
  <p><code>
  kubectl create -f test-service.yaml,test-deployment.yaml
  </code></p>
  
  <p>Once an IP has been exposed I assign a dns prefix to it so I can access my running container like so: <em>http</em>://nginx-test.westus.cloudapp.azure.com/.</p>
  
  <p><strong>My question is, how can I access the service using https? At http<em>s</em>://nginx-test.westus.cloudapp.azure.com/</strong></p>
  
  <p>I don't think I'm supposed to configure nginx for https, since the certificate is not mine. I've tried changing the load balancer to send 443 traffic to port 80, but I receive a timeout error.</p>
  
  <p>I tried mapping port 443 to port 80 in my Kubernetes service config.</p>
  
  <p><code>
  ports:
  - name: "443"
    port: 443
    targetPort: 80
  </code></p>
  
  <p>But that results in:</p>
  
  <p><code>
  SSL peer was not expecting a handshake message it received. Error code: SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT
  </code></p>
  
  <p>How can I view my running container at <a href="https://nginx-test.westus.cloudapp.azure.com/" rel="nofollow noreferrer">https://nginx-test.westus.cloudapp.azure.com/</a>?</p>