summaryrefslogtreecommitdiff
path: root/templates/dual-elasticsearch.vhost.erb
diff options
context:
space:
mode:
authorK Jonathan Harker <k.jonathan.harker@hp.com>2015-06-02 16:24:30 -0700
committerK Jonathan Harker <k.jonathan.harker@hp.com>2015-10-14 12:18:31 -0700
commit8c66da99df09a4cbd655141df891aee4c1a049f2 (patch)
tree8acd29921bf76a8dda2cbec01d534ff76c85c057 /templates/dual-elasticsearch.vhost.erb
parent3e95d92cfcbaeb9db7c994a28e7680f467cc9855 (diff)
Add kibana3 support
Add support for the javascript version of kibana. By default, this is done by serving both the kibana and also an elasticsearch proxy from the same location. Allowed GETs and POSTs for read-only access to elasticsearch are passed to a proxy and all other requests are served from the kibana source directory. An optional prefix, such as 'elasticsearch/', can be specified in which case the reverse proxy to elasticsearch will be served from this sub-path. Change-Id: I13f9dff0bbd6498a36dc75b026c9042a9bb05e8f
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Submitted-by: Jenkins Submitted-at: Wed, 14 Oct 2015 20:45:27 +0000 Reviewed-on: https://review.openstack.org/188907 Project: openstack-infra/puppet-kibana Branch: refs/heads/master
Diffstat (limited to 'templates/dual-elasticsearch.vhost.erb')
-rw-r--r--templates/dual-elasticsearch.vhost.erb41
1 files changed, 41 insertions, 0 deletions
diff --git a/templates/dual-elasticsearch.vhost.erb b/templates/dual-elasticsearch.vhost.erb
new file mode 100644
index 0000000..78b3394
--- /dev/null
+++ b/templates/dual-elasticsearch.vhost.erb
@@ -0,0 +1,41 @@
1<VirtualHost *:80>
2 ServerName <%= @vhost_name %>
3 ServerAdmin <%= @serveradmin %>
4<% if @serveraliases.is_a? Array %>
5<% serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
6<% elsif @serveraliases != '' %>
7<%= " ServerAlias #{serveraliases}" %>
8<% end %>
9
10 ErrorLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-error.log
11
12 LogLevel warn
13
14 CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined
15
16 <IfModule mod_proxy.c>
17 # Proxy GETs for elasticsearch .*/_aliases, .*/_status, .*/_search,
18 # .*/_mapping, .*/_mapping/field/.*, _cluster/health, _cluster/state/.*,
19 # _nodes. and _nodes/stats
20 # These GETs allow read-only access for kibana3, elasticsearch-head, and bigdesk,
21 # as well as arbitrary searches using the elasticsearch search api.
22 RewriteEngine on
23 RewriteCond %{REQUEST_METHOD} GET
24 RewriteRule ^<%= @elasticsearch_prefix %>((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping(/field(/.*)?)?|_cluster/(health|state(/.*)?)|_nodes(/stats)?)$ <%= @elasticsearch_url %>/$1 [P]
25 RewriteCond %{REQUEST_METHOD} POST
26 RewriteRule ^<%= @elasticsearch_prefix %>(_aliases|(.*/)?_search)$ <%= @elasticsearch_url %>/$1 [P]
27 RewriteCond %{REQUEST_METHOD} OPTIONS
28 RewriteRule ^<%= @elasticsearch_prefix %>((.*/)?_search)$ <%= @elasticsearch_url %>/$1 [P]
29 <Proxy <%= @elasticsearch_url %>/>
30 ProxySet connectiontimeout=<%= @vhost_proxy_connect_timeout %> timeout=<%= @vhost_proxy_timeout %>
31 </Proxy>
32 ProxyPassReverse <%= @elasticsearch_prefix %> <%= @elasticsearch_url %>/
33 </IfModule>
34
35 DocumentRoot <%= docroot %>
36 <Directory <%= docroot %>>
37 Options -Multiviews
38 </Directory>
39
40</VirtualHost>
41