Skip to content

Instantly share code, notes, and snippets.

@y-ken
Last active December 27, 2015 23:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y-ken/7408692 to your computer and use it in GitHub Desktop.
Save y-ken/7408692 to your computer and use it in GitHub Desktop.
Route Kibana-v3 and plugins of Head/bigdesk requests to ElasticSearch with authenticated user's own index with an Nginx reverse-proxy.
#
# Nginx proxy for Elasticsearch + Kibana
#
# In this setup, we are password protecting the saving of dashboards. You may
# wish to extend the password protection to all paths.
#
# Even though these paths are being called as the result of an ajax request, the
# browser will prompt for a username/password on the first request
#
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of
# http://FQDN:9200
#
upstream elasticsearch {
server 127.0.0.1:9200;
}
server {
listen *:80 ;
server_name kibana.myhost.org;
access_log /var/log/nginx/kibana.myhost.org.access.log;
satisfy any;
allow 192.168.0.0/16;
allow 10.0.0.0/8;
allow 127.0.0.1;
deny all;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd;
location /kibana/ {
root /usr/share/nginx/www;
index index.html index.htm;
}
location / {
proxy_pass http://elasticsearch;
proxy_read_timeout 90;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment