Nginx config for reverse proxying Kibana 5.1.1

I am newbie to Nginx and reverse proxy

I am struggling to make accessing of kibana through Nginx work with latest versions of Kibana Kibana 5.1.1

This is current config

server {
listen 8070;
location ~ /analytics/(?<kibana_uri>.*) {
proxy_pass https://stag.xxxxx.xxxx.es.amazonaws.com:5601/$kibana_uri;
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;
}
}

server.basepath : "/analytics"

I want to redirect all request for /analytics to my kibana server instance. but all I am getting is 404.Please help me with some example config if anyone has done it earlier.

And how should be the access link For eg: http://server/analytics

Hi @Ramya,

from your config snippet it looks like $kibana_uri is not defined. I guess for your purpose you want to assign that name to the regex capture group as in location ~ /analytics/(?<kibana_uri>.*) {.

To get http://server/analytics to work you probably also need to handle the case of the missing trailing slash. As suggested in Can someone share nginx config for reverse proxying Kibana4.4/4,5, this might do the trick:

location = /analytics {
   return 302 /analytics/;
}

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