Created
February 12, 2015 10:50
-
-
Save geetanjaligg/95f54fcd0b06669867a0 to your computer and use it in GitHub Desktop.
Nginx config file to secure Kibana/Elasticsearch
This file contains hidden or 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
server { | |
listen *:443 ; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/server.crt; | |
ssl_certificate_key /etc/nginx/ssl/server.key; | |
server_name kryptos; | |
access_log /var/log/nginx/kibana.access.log; | |
location / { | |
root /var/www/kibana; | |
index index.html index.htm; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
location ~ ^/_aliases$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
location ~ ^/.*/_aliases$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
location ~ ^/_nodes$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
location ~ ^/.*/_search$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
location ~ ^/.*/_mapping$ { | |
proxy_pass http://127.0.0.1:9200; | |
proxy_read_timeout 90; | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; | |
} | |
# 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-write.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-write.htpasswd; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment