Proxy is not working in 4.4 kibana


#1

Dear Team,

I added serverbase/baseurl in the kibana.yml. It is not taking that . Could you please tell me how to add proxy to kibana4.4

Thanks In Advance.

Regards
Sreenivasu


(Shaunak Kashyap) #2

Can you share the following information, please?

  1. The exact line from kibana.yml where you are setting the server basepath.
  2. The entire output of running ./bin/kibana.

#3

Dear Shaunak,

Please find the requested data.

Kiabana.yml

Kibana is served by a back end server. This controls which port to use.

server.port: 5601

The host to bind the server to.

server.host: "192.168.17.73"

If you are running kibana behind a proxy, and want to mount it at a path,

specify that path here. The basePath can't end in a slash.

server.basePath: "/kibana"

The maximum payload size in bytes on incoming server requests.

server.maxPayloadBytes: 1048576

The Elasticsearch instance to use for all your queries.

elasticsearch.url: "http://192.168.17.73:9200"

preserve_elasticsearch_host true will send the hostname specified in elasticsearch. If you set it to false,

then the host you use to connect to this Kibana instance will be sent.

elasticsearch.preserveHost: true

Kibana uses an index in Elasticsearch to store saved searches, visualizations

and dashboards. It will create a new index if it doesn't already exist.

kibana.index: ".kibana"

The default application to load.

kibana.defaultAppId: "discover"

If your Elasticsearch is protected with basic auth, these are the user credentials

used by the Kibana server to perform maintenance on the kibana_index at startup. Your Kibana

users will still need to authenticate with Elasticsearch (which is proxied through

the Kibana server)

elasticsearch.username: "user"

elasticsearch.password: "pass"

SSL for outgoing requests from the Kibana Server to the browser (PEM formatted)

server.ssl.cert: /path/to/your/server.crt

server.ssl.key: /path/to/your/server.key

Optional setting to validate that your Elasticsearch backend uses the same key files (PEM formatted)

elasticsearch.ssl.cert: /path/to/your/client.crt

elasticsearch.ssl.key: /path/to/your/client.key

If you need to provide a CA certificate for your Elasticsearch instance, put

the path of the pem file here.

elasticsearch.ssl.ca: /path/to/your/CA.pem

Set to false to have a complete disregard for the validity of the SSL

certificate.

elasticsearch.ssl.verify: true

Time in milliseconds to wait for elasticsearch to respond to pings, defaults to

request_timeout setting

elasticsearch.pingTimeout: 1500

Time in milliseconds to wait for responses from the back end or elasticsearch.

This must be > 0

elasticsearch.requestTimeout: 300000

Time in milliseconds for Elasticsearch to wait for responses from shards.

Set to 0 to disable.

elasticsearch.shardTimeout: 0

Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying

elasticsearch.startupTimeout: 5000

Set the path to where you would like the process id file to be created.

pid.file: /var/run/kibana.pid

If you would like to send the log output to a file you can set the path below.

logging.dest: stdout

Set this to true to suppress all logging output.

logging.silent: false

Set this to true to suppress all logging output except for error messages.

logging.quiet: false

Set this to true to log all events, including system usage information and all requests.

logging.verbose: false

Kiaban.log

log [19:12:20.680] [info][optimize] Optimizing and caching bundles for kibana and statusPage. This may take a few minutes
log [19:12:58.241] [info][optimize] Optimization of bundles for kibana and statusPage complete in 37.56 seconds
log [19:12:58.268] [info][status][plugin:kibana] Status changed from uninitialized to green - Ready
log [19:12:58.313] [info][status][plugin:elasticsearch] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [19:12:58.334] [info][status][plugin:kbn_vislib_vis_types] Status changed from uninitialized to green - Ready
log [19:12:58.340] [info][status][plugin:markdown_vis] Status changed from uninitialized to green - Ready
log [19:12:58.355] [info][status][plugin:metric_vis] Status changed from uninitialized to green - Ready
log [19:12:58.359] [info][status][plugin:spyModes] Status changed from uninitialized to green - Ready
log [19:12:58.362] [info][status][plugin:elasticsearch] Status changed from yellow to green - Kibana index ready
log [19:12:58.363] [info][status][plugin:statusPage] Status changed from uninitialized to green - Ready
log [19:12:58.367] [info][status][plugin:table_vis] Status changed from uninitialized to green - Ready
log [19:12:58.383] [info][listening] Server running at http://192.168.17.73:5601

Thanks
Sreenivasu


How to monitor kibana from CLI(command line interface)
(Shaunak Kashyap) #4

All of that looks good. When you say (in your original post), "it is not taking that", what exactly is happening? Any errors you can post here?


#5

http://172.29.106.161:5601 , If I add server.basePath: "/kibana" in kibana.yml ,
I can use the url like this http://172.29.106.161/kibana in old version of kibana, where as in nwe version it is not working.

Basically I am trying to avoid the port number.

Thanks
Sreenivasu


(Shaunak Kashyap) #6

What proxy are you using? Can you share your proxy config as well? I can try to reproduce this issue.


#7

I am using ngnix proxy.

location ~* /kibana {
access_log /var/log/nginx/kibana.access.log main;
error_log /var/log/nginx/kibana.error.log;
rewrite ^/$ /kibana/$1 break;
rewrite ^/kibana/(.*) /kibana/$1 break;
proxy_pass http://kibana_tool_v1;
proxy_redirect off;
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 X-NginX-Proxy true;
}


#8

Dear Shaunak,

Did you get chance to check this.

Thanks
Sreeni


#9

Any update would be appriciated.

Thanks
Sreeni


(Marcin Kubica) #10

Here's my nginx conf

$ cat /etc/nginx/conf.d/kibana.conf
server {
    listen 80;
    server_name kibana;


    error_log   /var/log/nginx/kibana.error.log;
    access_log  /var/log/nginx/kibana.access.log;



     location / {
        rewrite ^/(.*) /$1 break;
        proxy_ignore_client_abort on;
        proxy_pass http://localhost:5601;
        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_read_timeout 6m;
        }
}

(system) #11