Skip to content

Commit

Permalink
add nginx search query proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberflow committed Oct 6, 2014
1 parent 4ebcc9c commit 053e75c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@

#<> Boolean switch to enable SSL configuration.
default['kibana']['nginx']['ssl'] = false
#<> Boolean switch to enable nginx search query proxy
default['kibana']['nginx']['proxy'] = false

#<> The path to the SSL certificate file.
default['kibana']['nginx']['ssl_certificate'] = nil
Expand Down
25 changes: 13 additions & 12 deletions recipes/nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
owner node['nginx']['user']
mode '0644'
variables(
'root' => File.join(node['kibana']['base_dir'], 'current'),
'log_dir' => node['nginx']['log_dir'],
'listen_http' => node['kibana']['nginx']['listen_http'],
'listen_https' => node['kibana']['nginx']['listen_https'],
'client_max_body' => node['kibana']['nginx']['client_max_body'],
'server_name' => node['kibana']['nginx']['server_name'],
'ssl' => node['kibana']['nginx']['ssl'],
'ssl_certificate' => node['kibana']['nginx']['ssl_certificate'],
'root' => File.join(node['kibana']['base_dir'], 'current'),
'log_dir' => node['nginx']['log_dir'],
'listen_http' => node['kibana']['nginx']['listen_http'],
'listen_https' => node['kibana']['nginx']['listen_https'],
'client_max_body' => node['kibana']['nginx']['client_max_body'],
'server_name' => node['kibana']['nginx']['server_name'],
'ssl' => node['kibana']['nginx']['ssl'],
'ssl_certificate' => node['kibana']['nginx']['ssl_certificate'],
'ssl_certificate_key' => node['kibana']['nginx']['ssl_certificate_key'],
'ssl_protocols' => node['kibana']['nginx']['ssl_protocols'],
'ssl_ciphers' => node['kibana']['nginx']['ssl_ciphers'],
'ssl_session_cache' => node['kibana']['nginx']['ssl_session_cache'],
'ssl_session_timeout' => node['kibana']['nginx']['ssl_session_timeout']
'ssl_protocols' => node['kibana']['nginx']['ssl_protocols'],
'ssl_ciphers' => node['kibana']['nginx']['ssl_ciphers'],
'ssl_session_cache' => node['kibana']['nginx']['ssl_session_cache'],
'ssl_session_timeout' => node['kibana']['nginx']['ssl_session_timeout'],
'proxy' => node['kibana']['nginx']['proxy']
)
end

Expand Down
34 changes: 33 additions & 1 deletion templates/default/nginx.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,40 @@ server {
access_log <%= @log_dir %>/<%= @server_name %>.log;


location / {
location / {
root <%= @root %>;
index index.html index.htm;
}

<% if @proxy %>
location ~ ^/_aliases$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
location ~ ^/.*/_aliases$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
location ~ ^/_nodes$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
location ~ ^/.*/_search$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
location ~ ^/.*/_mapping {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}

location ~ ^/kibana-int/dashboard/.*$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
location ~ ^/kibana-int/temp.*$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
<% end %>
}

0 comments on commit 053e75c

Please sign in to comment.