Skip to content

Instantly share code, notes, and snippets.

@moznion
Created December 14, 2017 13:44
Show Gist options
  • Save moznion/ab60e8deb3282e36bb30419984d776ec to your computer and use it in GitHub Desktop.
Save moznion/ab60e8deb3282e36bb30419984d776ec to your computer and use it in GitHub Desktop.
nginx configuration file for kibana with oauth2_proxy
user nginx;
pid /var/run/nginx.pid;
worker_processes auto;
events {
use epoll;
}
http {
server {
listen 80;
server_name kibana.example.com;
location ~ ^/oauth2/(?:auth|start)$ {
internal;
proxy_pass http://oauth2-proxy:4180;
proxy_set_header Host $host;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
}
location = /oauth2/callback {
auth_request off;
proxy_pass http://oauth2-proxy:4180;
proxy_set_header Host $host;
}
location / {
satisfy any;
auth_request /oauth2/auth;
error_page 401 = /oauth2/start?rd=$uri;
allow 127.0.0.1;
deny all;
proxy_read_timeout 300;
proxy_pass http://kibana:5601;
}
}
}
daemon off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment