mohit
mohit

Reputation: 2491

Kibana did not load properly. After setting up with nginx reverse proxy

I have setup the reverse proxy for the aws elastic search endpoint on a server on port 9200. I am trying to access kibana on that particular server with /kibana URI. But I am getting below error.

Kibana did not load properly. Check the server output for more information.

Nginx Code:

For ElasticSearch:

server {
    listen 9002;
    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         https://search.us-west-2.es.amazonaws.com;
    }
}

For Kibana

location /kibana/ {
        proxy_set_header Host https://search-es.us-west-2.es.amazonaws.com/_plugin/kibana/;
        proxy_set_header X-Real-IP 34.214.177.249;
        proxy_pass https://search-es.us-west-2.es.amazonaws.com/_plugin/kibana/;
        proxy_redirect https://search-es.us-west-2.es.amazonaws.com/_plugin/kibana/ http://ab.cd.ef.g/kibana/;
        }

For My App:

location / {
                proxy_redirect off;
                proxy_pass http://127.0.0.1:3054;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                }

I am also getting a lot of below console error.

Failed to load resource: the server responded with a status of 502 (Bad Gateway).

http://ab.cd.ef.g//_plugin/kibana/ui/favicons/favicon.ico

Any hint would be appreciated.

Upvotes: 2

Views: 3899

Answers (2)

Kotireddy
Kotireddy

Reputation: 1235

Nginx reverse proxy setup for Kibana:

I am using Kibana 7.5 version I have faced this issue with Nginx. I have added configuration for following entries in the Nginx configuration file. It is fixed.

/app|/translations|/node_modules|/built_assets/|/bundles|/es_admin|/plugins|/api|/ui|/elasticsearch|/spaces/enter

Upvotes: 1

Tyler Smalley
Tyler Smalley

Reputation: 301

You need to set server.basePath to /kibana

Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests to Kibana. This setting cannot end in a slash (/).

Upvotes: 0

Related Questions