Modernize kibana vhost template
In the past it was common to do scope.lookupvar but now it is only required when explicitly grabbing a different scope. All the variables in kibana.vhost.erb are available from the class that calls the template() function. Change-Id: I100bb764b5742b1f3068e5b86813c825f9f71868
This commit is contained in:
parent
f76780d6cb
commit
14a6ec4c99
@ -1,12 +1,12 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName <%= scope.lookupvar("::logstash::web::vhost_name") %>
|
ServerName <%= @vhost_name %>
|
||||||
ServerAdmin <%= scope.lookupvar("::logstash::web::serveradmin") %>
|
ServerAdmin <%= @serveradmin %>
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-error.log
|
ErrorLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-error.log
|
||||||
|
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-access.log combined
|
CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined
|
||||||
|
|
||||||
<IfModule mod_proxy.c>
|
<IfModule mod_proxy.c>
|
||||||
<% if @proxy_elasticsearch == true %>
|
<% if @proxy_elasticsearch == true %>
|
||||||
@ -14,15 +14,15 @@
|
|||||||
# .*/_mapping, .*/_mapping/field/.*, _cluster/health, and _nodes.
|
# .*/_mapping, .*/_mapping/field/.*, _cluster/health, and _nodes.
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteCond %{REQUEST_METHOD} GET
|
RewriteCond %{REQUEST_METHOD} GET
|
||||||
RewriteRule ^/elasticsearch/((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping|(.*/)?_mapping/field/(.*)?|_cluster/health|_nodes)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P]
|
RewriteRule ^/elasticsearch/((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping|(.*/)?_mapping/field/(.*)?|_cluster/health|_nodes)$ http://<%= @discover_nodes[0] %>/$1 [P]
|
||||||
RewriteCond %{REQUEST_METHOD} POST
|
RewriteCond %{REQUEST_METHOD} POST
|
||||||
RewriteRule ^/elasticsearch/(_aliases|(.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P]
|
RewriteRule ^/elasticsearch/(_aliases|(.*/)?_search)$ http://<%= @discover_nodes[0] %>/$1 [P]
|
||||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||||
RewriteRule ^/elasticsearch/((.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P]
|
RewriteRule ^/elasticsearch/((.*/)?_search)$ http://<%= @discover_nodes[0] %>/$1 [P]
|
||||||
<Proxy http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/>
|
<Proxy http://<%= @discover_nodes[0] %>/>
|
||||||
ProxySet connectiontimeout=15 timeout=120
|
ProxySet connectiontimeout=15 timeout=120
|
||||||
</Proxy>
|
</Proxy>
|
||||||
ProxyPassReverse /elasticsearch/ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/
|
ProxyPassReverse /elasticsearch/ http://<%= @discover_nodes[0] %>/
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
ProxyPass / http://127.0.0.1:5601/ retry=0
|
ProxyPass / http://127.0.0.1:5601/ retry=0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user