Created
December 14, 2017 13:44
-
-
Save moznion/ab60e8deb3282e36bb30419984d776ec to your computer and use it in GitHub Desktop.
nginx configuration file for kibana with oauth2_proxy
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
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