title: 503 Service Temporarily Unavailable Nginx + Kibana + AKS
body: <p>I have deployed Kibana in AKS with the server.basepath of <code>/logs</code> since I want it to be deployed in subpath. I am trying to access Kibana service using nginx controller It is giving 503 service unavailable but Service/Pod is running. Please help me on this.</p>
  
  <p>Kibana Deployment:</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: kibana
    namespace: kube-logging
    labels:
      app.kubernetes.io/name: kibana
      helm.sh/chart: kibana-0.1.0
      app.kubernetes.io/instance: icy-coral
      app.kubernetes.io/managed-by: Tiller
  spec:
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: kibana
        app.kubernetes.io/instance: icy-coral
    template:
      metadata:
        labels:
          app.kubernetes.io/name: kibana
          app.kubernetes.io/instance: icy-coral
      spec:
        containers:
          - name: kibana
            image: "docker.elastic.co/kibana/kibana:7.6.0"
            imagePullPolicy: IfNotPresent
            ports:
              - name: http
                containerPort: 5601
                protocol: TCP
            env:
              - name: ELASTICSEARCH_URL
                value: http://elasticsearch:9200
              - name: SERVER_BASEPATH
                value: /logs
              - name: SERVER_REWRITEBASEPATH
                value: "true"
            resources:
              limits:
                cpu: 1000m
              requests:
                cpu: 100m
  </code></pre>
  
  <p>Kibana service:</p>
  
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: kibana
    namespace: kube-logging
    labels:
      app.kubernetes.io/name: kibana
      helm.sh/chart: kibana-0.1.0
      app.kubernetes.io/instance: icy-coral
      app.kubernetes.io/managed-by: Tiller
  spec:
    type: ClusterIP
    ports:
      - port: 80
        targetPort: 5601
        protocol: TCP
        name: http
    selector:
      app.kubernetes.io/name: kibana
      app.kubernetes.io/instance: icy-coral
  </code></pre>
  
  <p>Kibana Ingress:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: kibana
    labels:
      app.kubernetes.io/name: kibana
      helm.sh/chart: kibana-0.1.0
      app.kubernetes.io/instance: icy-coral
      app.kubernetes.io/managed-by: Tiller
    annotations:
      ingress.kubernetes.io/send-timeout: "600"
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
      nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
      nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
      nginx.ingress.kubernetes.io/rewrite-target: /$1
      nginx.ingress.kubernetes.io/ssl-redirect: "false"
  
  spec:
    rules:
      - host: ""
        http:
          paths:
            - path: /logs/?(.*)
              backend:
                serviceName: kibana
                servicePort: 80
  </code></pre>