summaryrefslogtreecommitdiff
path: root/templates/dual-elasticsearch.vhost.erb
diff options
context:
space:
mode:
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