Skip to content

Instantly share code, notes, and snippets.

@ipmb
Created October 22, 2014 16:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ipmb/e9326f01b5eca322c922 to your computer and use it in GitHub Desktop.
Save ipmb/e9326f01b5eca322c922 to your computer and use it in GitHub Desktop.
Hack to put Google auth in front of Kibana and ES
upstream elasticsearch {
# google auth proxy -> elasticsearch
server 127.0.0.1:9201;
}
server {
root /path/to/kibana;
# insert standard Nginx boilerplate...
location @elasticsearch {
proxy_pass http://elasticsearch;
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-Forwarded-Proto https;
}
location / {
# send un-authed requests to backend for auth
if ($cookie__OAUTHPROXY = "") {
error_page 403 = @elasticsearch;
return 403;
}
try_files $uri $uri/index.html @elasticsearch;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment