Skip to content

Instantly share code, notes, and snippets.

@kakbit
Created August 9, 2013 10:30
Show Gist options
  • Save kakbit/6192679 to your computer and use it in GitHub Desktop.
Save kakbit/6192679 to your computer and use it in GitHub Desktop.
My kibanatest apache conf
<VirtualHost *:80>
ServerName kibanatest.buskas.org
ServerAlias kibanatest.buskas.org
Use logstash_log kibanatest.buskas.org kibanatest.buskas.org
DocumentRoot "/var/www/kibana3"
# Elasticsearch API is behind /es/
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|DELETE)
RewriteRule .* - [F]
RewriteCond %{LA-U:REMOTE_USER} !^$
RewriteRule /es/(.*)logstash-([0-9]+.[0-9]+.[0-9]+)(.*) /es/$1%{LA-U:REMOTE_USER}-$2$3 [N] # Redirect all logstash-xx-xx-xx accesses to user aliases
RewriteCond %{LA-U:REMOTE_USER} !^$
RewriteRule /es/(.*) http://127.0.0.1:9200/$1 [P,L] # proxy to local ES service
RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 1
<Location /es/>
AuthType Basic
AuthName "Secured"
AuthUserFile /etc/httpd/conf.d/.htpasswd-logstash
Require valid-user
Satisfy any
Deny from all
Options -MultiViews
</Location>
<Directory /var/www/kibana3>
AuthType Basic
AuthName "Secured"
AuthUserFile /etc/httpd/conf.d/.htpasswd-logstash
Require valid-user
Satisfy any
Deny from all
Allow from 192.168.2.27
Options -MultiViews
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment