
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
42 lines
1.7 KiB
Plaintext
42 lines
1.7 KiB
Plaintext
<VirtualHost *:80>
|
|
ServerName <%= @vhost_name %>
|
|
ServerAdmin <%= @serveradmin %>
|
|
<% if @serveraliases.is_a? Array %>
|
|
<% serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
|
|
<% elsif @serveraliases != '' %>
|
|
<%= " ServerAlias #{serveraliases}" %>
|
|
<% end %>
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-error.log
|
|
|
|
LogLevel warn
|
|
|
|
CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined
|
|
|
|
<IfModule mod_proxy.c>
|
|
# Proxy GETs for elasticsearch .*/_aliases, .*/_status, .*/_search,
|
|
# .*/_mapping, .*/_mapping/field/.*, _cluster/health, _cluster/state/.*,
|
|
# _nodes. and _nodes/stats
|
|
# These GETs allow read-only access for kibana3, elasticsearch-head, and bigdesk,
|
|
# as well as arbitrary searches using the elasticsearch search api.
|
|
RewriteEngine on
|
|
RewriteCond %{REQUEST_METHOD} GET
|
|
RewriteRule ^<%= @elasticsearch_prefix %>((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping(/field(/.*)?)?|_cluster/(health|state(/.*)?)|_nodes(/stats)?)$ <%= @elasticsearch_url %>/$1 [P]
|
|
RewriteCond %{REQUEST_METHOD} POST
|
|
RewriteRule ^<%= @elasticsearch_prefix %>(_aliases|(.*/)?_search)$ <%= @elasticsearch_url %>/$1 [P]
|
|
RewriteCond %{REQUEST_METHOD} OPTIONS
|
|
RewriteRule ^<%= @elasticsearch_prefix %>((.*/)?_search)$ <%= @elasticsearch_url %>/$1 [P]
|
|
<Proxy <%= @elasticsearch_url %>/>
|
|
ProxySet connectiontimeout=<%= @vhost_proxy_connect_timeout %> timeout=<%= @vhost_proxy_timeout %>
|
|
</Proxy>
|
|
ProxyPassReverse <%= @elasticsearch_prefix %> <%= @elasticsearch_url %>/
|
|
</IfModule>
|
|
|
|
DocumentRoot <%= docroot %>
|
|
<Directory <%= docroot %>>
|
|
Options -Multiviews
|
|
</Directory>
|
|
|
|
</VirtualHost>
|
|
|