title: SSL certificate configuration for Angular Application hosted using Docker & Azure Kubernetes (AKS)
body: <p>I'm using Azure Kubernetes to a host Angular web app using Docker Container.
  I have created SSL certificate using OpenSSL commands. Now, I need to configure HTTPS and SSL certificate to my web app.</p>
  <p>Please help me how to set up these?</p>
  <p>Here's my <strong>Docker</strong> File</p>
  <pre><code>FROM nginx:latest as nginx
  RUN rm -rf /usr/share/nginx/html/*
  COPY /dist/merch-insight/nginx.conf /etc/nginx/conf.d/nginx.conf
  COPY /dist/merch-insight /usr/share/nginx/html
  EXPOSE 80
  CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]
  </code></pre>
  <p>Here's my <strong>nginx.conf</strong> file</p>
  <pre><code>server {
    server_name my-app;
    charset utf-8;
    sendfile on;
    root /usr/share/nginx/html;
  
    #Caches static assets
    location ~ ^/(assets|bower_components|scripts|styles|views) {
      expires     31d;
      add_header  Cache-Control public;
    }
  
    #Caches Bundles created by angular cli
    location ~* \.(?:bundle.js|bundle.css)$ {
      expires 1M;
      access_log off;
      add_header Cache-Control &quot;public&quot;;
    }
  
    ##
    # Main file index.html sending not found locations to the main
    ##
    location / {
      expires -1;
      add_header Pragma &quot;no-cache&quot;;
      add_header Cache-Control &quot;no-store, no-cache, must-revalidate, post-check=0, pre-check=0&quot;;
      index index.html index.htm;
      try_files $uri $uri/ /index.html;
    }
  }
  </code></pre>
  <p>And here is my <strong>yaml</strong> file</p>
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      app: apweb
      version: v1
    name: apweb
    namespace: default
  spec:
    selector:
      matchLabels:
        run: apweb
    replicas: 2
  
    template:
      metadata:
        labels:
          run: apweb
      spec:
        containers:
        - name: apweb
          image: mycontainerregistry.azurecr.io/apweb:dev
          imagePullPolicy: Always
          ports:
          - containerPort: 80
  ---
  apiVersion: v1
  kind: Service
  metadata:
    labels:
      app: apweb
      version: v1
    name: apweb-service
    namespace: default
  spec:
    type: LoadBalancer
    ports:
    - port: 80
      protocol: TCP
      targetPort: 80
      name: http-web
    selector:
      run: apweb
  </code></pre>