Created
October 22, 2014 16:31
-
-
Save ipmb/e9326f01b5eca322c922 to your computer and use it in GitHub Desktop.
Hack to put Google auth in front of Kibana and ES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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