Kibana returns "statusCode": 404 in simple docker stack

Hey,
I have this simple stack of Elasticsearch + Kibana + Nginx for SSL. And I am not sure why Kibana returns on example.com:4444/kibana this response:

{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found"
}

Can anybody see problem what I have here? I am able to see correct result from elasticsearch, but I have no success with kibana yet. Any advice is welcomed!

STACK:

  • command: docker compose -f docker-stack.yml up

  • my docker-stack.yml

version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0
    container_name: elasticsearch
    environment:
      - "discovery.type=single-node"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - bootstrap.memory_lock=true
      - "xpack.security.enabled=false"
      - "ELASTIC_PASSWORD=XXX"
    volumes:
      - esdata:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    restart: on-failure

  kibana:
    image: docker.elastic.co/kibana/kibana:8.8.0
    container_name: kibana
    ports:
      - 5601:5601
    restart: on-failure
    environment:
      ELASTICSEARCH_HOSTS: http://elasticsearch:9200
      ELASTICSEARCH_PASSWORD: "XXX"
      "server.basePath": "/kibana"
      "server.rewriteBasePath": "true"
    depends_on:
      - elasticsearch
  nginx:
    image: nginx
    container_name: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./certs:/etc/own-certs/certs
    ports:
      - 4444:4444
    depends_on:
      - kibana
volumes:
  esdata:
    driver: local
  • nginx.conf
events {
    worker_connections 1024;
}

http {
    server {
        listen 4444 ssl;
        server_name example.com;

        ssl_certificate /etc/own-certs/certs/fullchain.crt;
        ssl_certificate_key /etc/own-certs/certs/server.key;

        location /elasticsearch {
            proxy_pass http://elasticsearch:9200/;
            proxy_redirect off;
            proxy_buffering off;
            proxy_http_version 1.1;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header Connection "Keep-Alive";
            proxy_set_header Proxy-Connection "Keep-Alive";
            proxy_pass_header Access-Control-Allow-Origin;
            proxy_pass_header Access-Control-Allow-Methods;
            proxy_hide_header Access-Control-Allow-Headers;
            add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
            add_header Access-Control-Allow-Credentials true;
        }

        location /kibana {
            proxy_pass http://kibana:5601;
            proxy_redirect off;
            proxy_buffering off;

            proxy_http_version 1.1;
            proxy_set_header Connection "Keep-Alive";
            proxy_set_header Proxy-Connection "Keep-Alive";
        }
    }
}

Is there anything showing up on the 5601? That would be my first step in troubleshooting.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.