Created
October 6, 2014 20:48
-
-
Save thisismitch/2205786838a6a5d61f55 to your computer and use it in GitHub Desktop.
Nginx server block for Kibana
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
# | |
# Nginx proxy for Elasticsearch + Kibana | |
# | |
# In this setup, we are password protecting the saving of dashboards. You may | |
# wish to extend the password protection to all paths. | |
# | |
# Even though these paths are being called as the result of an ajax request, the | |
# browser will prompt for a username/password on the first request | |
# | |
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of | |
# http://FQDN:9200 | |
# | |
server { | |
listen *:80 ; | |
server_name kibana.myhost.org; | |
access_log /var/log/nginx/kibana.myhost.org.access.log; | |
location / { | |
root /usr/share/kibana3; | |
index index.html index.htm; | |
} | |
location ~ ^/_aliases$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
} | |
location ~ ^/.*/_aliases$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
} | |
location ~ ^/_nodes$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
} | |
location ~ ^/.*/_search$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
} | |
location ~ ^/.*/_mapping { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
} | |
# Password protected end points | |
location ~ ^/kibana-int/dashboard/.*$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
limit_except GET { | |
proxy_pass http://127.0.0.1:9200; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; | |
} | |
} | |
location ~ ^/kibana-int/temp.*$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
limit_except GET { | |
proxy_pass http://127.0.0.1:9200; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all thanks for providing the nginx.conf. We are using the Bulk API in ElasticSearch, and had to add a location mapping for that. Here is my modified nginx.conf in case you're interested. The modification is ridiculously simple. Just wanted to let you know.