45 lines
2.1 KiB
Plaintext
45 lines
2.1 KiB
Plaintext
<VirtualHost *:80>
|
|
ServerName <%= @vhost_name %>
|
|
ServerAdmin <%= scope.lookupvar('::kibana::js::serveradmin') %>
|
|
<% if @serveraliases.is_a? Array %>
|
|
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
|
|
<% elsif ! ['', nil].include?(@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 ^<%= scope.lookupvar('::kibana::js::elasticsearch_prefix') %>((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping(/field(/.*)?)?|_cluster/(health|state(/.*)?)|_nodes(/stats)?)$ <%= scope.lookupvar('::kibana::js::elasticsearch_url') %>/$1 [P]
|
|
RewriteCond %{REQUEST_METHOD} POST
|
|
RewriteRule ^<%= scope.lookupvar('::kibana::js::elasticsearch_prefix') %>(_aliases|(.*/)?_search)$ <%= scope.lookupvar('::kibana::js::elasticsearch_url') %>/$1 [P]
|
|
RewriteCond %{REQUEST_METHOD} OPTIONS
|
|
RewriteRule ^<%= scope.lookupvar('::kibana::js::elasticsearch_prefix') %>((.*/)?_search)$ <%= scope.lookupvar('::kibana::js::elasticsearch_url') %>/$1 [P]
|
|
<Proxy <%= scope.lookupvar('::kibana::js::elasticsearch_url') %>/>
|
|
ProxySet connectiontimeout=<%= scope.lookupvar('::kibana::js::vhost_proxy_connect_timeout') %> timeout=<%= scope.lookupvar('::kibana::js::vhost_proxy_timeout') %>
|
|
</Proxy>
|
|
ProxyPassReverse <%= scope.lookupvar('::kibana::js::elasticsearch_prefix') %> <%= scope.lookupvar('::kibana::js::elasticsearch_url') %>/
|
|
</IfModule>
|
|
|
|
DocumentRoot <%= @docroot %>
|
|
<Directory <%= @docroot %>>
|
|
Options -Multiviews
|
|
<IfVersion >= 2.4>
|
|
Require all granted
|
|
</IfVersion>
|
|
</Directory>
|
|
|
|
</VirtualHost>
|
|
|