Instantly share code, notes, and snippets.

Embed
What would you like to do?
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