From 9cd3fcf314c6c1b79bb6f490a6256932f79d800a Mon Sep 17 00:00:00 2001 From: Robin Clarke Date: Wed, 4 Dec 2013 12:19:45 +0100 Subject: [PATCH 1/2] Added a sample lighttpd configuration for basic authentication --- sample/lighttpd_basic.conf | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sample/lighttpd_basic.conf diff --git a/sample/lighttpd_basic.conf b/sample/lighttpd_basic.conf new file mode 100644 index 00000000000..4326cd99154 --- /dev/null +++ b/sample/lighttpd_basic.conf @@ -0,0 +1,40 @@ +$HTTP["host"] =~ "kibana" { + + server.document-root = "/var/www/kibana/src" + auth.backend = "plain" + auth.backend.plain.userfile = "/etc/lighttpd/kibanapassword" + + index-file.names = ( "index.html", "index.htm" ) + + auth.require = ( "/" => ( + "method" => "basic", + "realm" => "Password Protected", + "require" => "valid-user" + ) + ) + + $HTTP["url"] =~ "^/kibana-int/temp.*$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } + $HTTP["url"] =~ "^/kibana-int/dashboard/.*$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } + $HTTP["url"] =~ "^/_mappings$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } + $HTTP["url"] =~ "^/_search$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } + $HTTP["url"] =~ "^/_nodes$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } + $HTTP["url"] =~ "^/_aliases$" { + proxy.balance = "hash" + proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) + } +} From e1688275a8639454303522b1ee89c2c173792238 Mon Sep 17 00:00:00 2001 From: Robin Clarke Date: Wed, 4 Dec 2013 14:19:00 +0100 Subject: [PATCH 2/2] Fixed and compacted rules --- sample/lighttpd_basic.conf | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/sample/lighttpd_basic.conf b/sample/lighttpd_basic.conf index 4326cd99154..667a6abe71c 100644 --- a/sample/lighttpd_basic.conf +++ b/sample/lighttpd_basic.conf @@ -1,6 +1,6 @@ $HTTP["host"] =~ "kibana" { - server.document-root = "/var/www/kibana/src" + server.document-root = "/var/ww/kibana/src" auth.backend = "plain" auth.backend.plain.userfile = "/etc/lighttpd/kibanapassword" @@ -13,27 +13,11 @@ $HTTP["host"] =~ "kibana" { ) ) - $HTTP["url"] =~ "^/kibana-int/temp.*$" { + $HTTP["url"] =~ "^/kibana-int/(dashboard/|temp).*$" { proxy.balance = "hash" proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) } - $HTTP["url"] =~ "^/kibana-int/dashboard/.*$" { - proxy.balance = "hash" - proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) - } - $HTTP["url"] =~ "^/_mappings$" { - proxy.balance = "hash" - proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) - } - $HTTP["url"] =~ "^/_search$" { - proxy.balance = "hash" - proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) - } - $HTTP["url"] =~ "^/_nodes$" { - proxy.balance = "hash" - proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) - } - $HTTP["url"] =~ "^/_aliases$" { + $HTTP["url"] =~ "^.*/_(mapping|search|nodes|aliases)$" { proxy.balance = "hash" proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9200" ) ) ) }