This work for kibana 4.0.1. and I assume that you are running kibana on the same host as nginx, listening on port 5601.
Your nginx configuration should look like this:
server { listen *:80 ; server_name server; access_log /var/log/nginx/kibana.srv-log-dev.log; error_log /var/log/nginx/kibana.srv-log-dev.error.log; location / { root /var/www/kibana; index index.html index.htm; } location ~ ^/kibana4/.* { proxy_pass http://kibana4host:5601; rewrite ^/kibana4/(.*) /$1 break; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; auth_basic "Restricted"; auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; } }
Lines
auth_basic "Restricted"; auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd;
can be used to provide basic authentication on the site.
The access link will be http: // server / kibana4
source share