Kibana 7.12 nginx reverse proxy, docker compose

Hi Im trying to use nginx as a reverse proxy for kibana but I can make it work, this is my kibana.yml kibana "localhost"
elasticsearch.hosts: [ "https://elasticsearch:9200" ]
elasticsearch.username: kibana
elasticsearch.password: mypassword
server.ssl.enabled: true
server.ssl.certificate: /usr/share/kibana/newfile.crt.pem
server.ssl.key: /usr/share/kibana/newfile.key.pem
elasticsearch.ssl.verificationMode: none
xpack.encryptedSavedObjects.encryptionKey: "myencriptionkey"
server.publicBaseUrl: ""
server.basePath: "/kibana"
server.rewriteBasePath: true

this is the docker compose file

    - ./config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
    - ./certificates/newfile.crt.pem:/usr/share/kibana/newfile.crt.pem
    - ./certificates/newfile.key.pem:/usr/share/kibana/newfile.key.pem
    - "5601:5601"
    - elasticsearch
    container_name: kibana

    image: nginx
    - "6601:6601"
    - ./nginx/:/etc/nginx/conf.d/
    - ./nginx/:/var/log/nginx
    - kibana

and this is my default.conf for nginx

server {
    listen 6601;
    include /etc/nginx/default.d/*.conf;
    location /kibana/ {

        proxy_pass http://localhost:5601; 
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

this is one of the errors that im getting:

2021/04/21 00:39:04 [error] 22#22: *1 no live upstreams while connecting to upstream, client:, server: , request: "GET /kibana/ HTTP/1.1", upstream: "http://localhost/kibana/", host: "

what Im doing wrong?

This is wrong, it means that you want to pass the requests you are receiving in the nginx container on the port 6601 to the same container in the port 5601, localhost always means the same host.

You should try to set it to http://kibana:5601.

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