Revisions
-
karmi revised this gist
Oct 7, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,6 +34,7 @@ events { http { upstream elasticsearch { server 127.0.0.1:9200; keepalive 15; } server { @@ -47,6 +48,11 @@ http { proxy_pass http://elasticsearch; proxy_redirect off; proxy_buffering off; proxy_http_version 1.1; proxy_set_header Connection "Keep-Alive"; proxy_set_header Proxy-Connection "Keep-Alive"; } } -
karmi revised this gist
Jul 21, 2014 . 10 changed files with 143 additions and 99 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -80,10 +80,10 @@ local restrictions = { local role = ngx.var.remote_user ngx.log(ngx.DEBUG, role) -- exit 403 when no matching role has been found if restrictions[role] == nil then ngx.header.content_type = 'text/plain' ngx.log(ngx.WARN, "Unknown role ["..role.."]") ngx.status = 403 ngx.say("403 Forbidden: You don\'t have access to this resource.") return ngx.exit(403) @@ -114,14 +114,13 @@ for path, methods in pairs(restrictions[role]) do if p and m then allowed = true ngx.log(ngx.NOTICE, method.." "..uri.." matched: "..tostring(m).." "..tostring(path).." for "..role) break end end if not allowed then ngx.header.content_type = 'text/plain' ngx.log(ngx.WARN, "Role ["..role.."] not allowed to access the resource ["..method.." "..uri.."]") ngx.status = 403 ngx.say("403 Forbidden: You don\'t have access to this resource.") return ngx.exit(403) This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ # Generate passwords: # # $ printf "nobody:$(openssl passwd -crypt nobody)\n" >> passwords # $ printf "all:$(openssl passwd -crypt all)\n" >> passwords # $ printf "user:$(openssl passwd -crypt user)\n" >> passwords # $ printf "admin:$(openssl passwd -crypt admin)\n" >> passwords # # Install the Nginx with Lua support ("openresty"): # @@ -25,15 +25,15 @@ worker_processes 1; error_log logs/lua.log notice; events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_basic_proxy.conf # $ curl localhost:8000 # events { worker_connections 1024; } http { server { listen 8080; location / { proxy_pass http://localhost:9200; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" > passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_allow_path.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { listen 8080; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location ~* ^(/_cluster|/_nodes) { proxy_pass http://elasticsearch; proxy_redirect off; } location / { return 403; break; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,62 +1,58 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" > passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_allow_path_and_method.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { listen 8080; location / { error_page 590 = @elasticsearch; error_page 595 = @protected_elasticsearch; set $ok 0; if ($request_uri ~ ^/$) { set $ok "${ok}1"; } if ($request_method = HEAD) { set $ok "${ok}2"; } if ($ok = 012) { return 590; } return 595; } location @elasticsearch { proxy_pass http://elasticsearch; proxy_redirect off; } location @protected_elasticsearch { auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,32 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" > passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_basic.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { listen 8080; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location / { proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,38 +1,37 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" > passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_deny_path.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { listen 8080; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location / { if ($request_filename ~ _shutdown) { return 403; break; } proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,21 @@ # Generate passwords: # # $ printf "user:$(openssl passwd -crypt user)\n" > users # $ printf "admin:$(openssl passwd -crypt admin)\n" > admins # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_roles.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } # Allow HEAD / for all @@ -28,7 +28,7 @@ http { # server { listen 8080; server_name elasticsearch_all.local; location / { return 401; @@ -45,7 +45,7 @@ http { } } # Allow access to /_search and /_analyze for authenticated "users" # # curl -i 'http://localhost:8081/_search' # HTTP/1.1 401 Unauthorized @@ -61,7 +61,7 @@ http { # server { listen 8081; server_name elasticsearch_users.local; auth_basic "Elasticsearch Users"; auth_basic_user_file users; @@ -70,13 +70,13 @@ http { return 403; } location ~* ^(/_search|/_analyze) { proxy_pass http://elasticsearch; proxy_redirect off; } } # Allow access to anything for authenticated "admins" # # curl -i 'http://admin:admin@localhost:8082/_search' # HTTP/1.1 200 OK @@ -86,7 +86,7 @@ http { # server { listen 8082; server_name elasticsearch_admins.local; auth_basic "Elasticsearch Admins"; auth_basic_user_file admins; This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,21 +10,20 @@ events { http { upstream elasticsearch { server 127.0.0.1:9200; keepalive 15; } server { listen 8080; location / { proxy_pass http://elasticsearch; proxy_http_version 1.1; proxy_set_header Connection "Keep-Alive"; proxy_set_header Proxy-Connection "Keep-Alive"; } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_load_balancer.conf # events { @@ -10,8 +10,9 @@ events { http { upstream elasticsearch { server 127.0.0.1:9200; server 127.0.0.1:9201; server 127.0.0.1:9202; } server { -
karmi revised this gist
Dec 17, 2013 . 12 changed files with 561 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,79 @@ Example Nginx Configurations for Elasticsearch ============================================== This repository contains couple of example configurations for using Nginx as a proxy for Elasticsearch. These examples can be run standalone from this repository -- the general pattern is: $ nginx -p $PWD/nginx/ -c $PWD/<CONFIG FILE> When you change the configuration, simply _reload_ the Nginx process to pick up the changes: $ nginx -p $PWD/nginx/ -c $PWD/<CONFIG FILE> -s reload Please refer to the Nginx [documentation](http://nginx.org/en/docs/) for more information. ## `nginx_round_robin.conf` A simple proxy which distributes requests in a round-robin way across configured nodes. More information: <http://nginx.org/en/docs/http/ngx_http_upstream_module.html> ## `nginx_keep_alive.conf` Configures the proxy to keep a pool of persistent connections, preventing opening sockets at Elasticsearch for each connection, e.g. with deficient HTTP clients. More information: <http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive> ## `nginx_http_auth_basic.conf` The simplest possible authorization proxy for Elasticsearch: allow access only to users authenticated with HTTP Basic Auth, with credentials stored in a `passwords` file. ## `nginx_http_auth_deny_path.conf` A variation on the simple authorization proxy, which prevents access to certain URLs (`_shutdown`). ## `nginx_http_auth_allow_path_and_method.conf` A variation on the authorization proxy, which uses named `location`s to allow certain paths and methods without authorization. Demonstrates how to use error codes in Nginx configuration to route requests and how to work around the lack of multiple conditions in Nginx' `if` statement. More information: <http://wiki.nginx.org/RewriteMultiCondExample> ## `nginx_http_auth_roles.conf` Demonstrates how to use multiple Nginx servers to separate access rights for multiple types of users: unauthenticated, _users_ and _admins_. Unauthenticated users can access `HEAD /`, but nothing else. Authenticated _user_ can access only the `_search` and `_analyze` endpoints (with whatever HTTP method), other endpoints are denied. More information: <http://nginx.org/en/docs/http/ngx_http_core_module.html#location> ## `nginx_authorize_by_lua.conf` Demonstrates how to use custom logic for implementing authorization, via the [Lua](http://wiki.nginx.org/HttpLuaModule) support in Nginx. The request is authenticated against credentials in the `passwords` file and if allowed by the `access_by_lua_file` return value, proxied to Elasticsearch. The authorization logic is stored in the `authorize.lua` file, which contains a simple "dictionary" (in the form of Lua _table_) with rules for three "roles": anybody, users and admins. Based on the `$remote_user` Nginx variable value, the request path and method are evaluated against the dictionary, and the request is denied with "403 Forbidden" if no matching rule is found. Lua and Nginx Overview: <http://www.londonlua.org/scripting_nginx_with_lua/slides.html> More information: <http://openresty.org> This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ admin:bHw.s5hN/IvE6 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,128 @@ --[[ Provides Elasticserach endpoint authorization based on rules in Lua and authenticated user See the `nginx_authorize_by_lua.conf` for the Nginx config. Synopsis: $ /usr/local/openresty/nginx/sbin/nginx -p $PWD/nginx/ -c $PWD/nginx_authorize_by_lua.conf $ curl -i -X HEAD 'http://localhost:8080' HTTP/1.1 401 Unauthorized curl -i -X HEAD 'http://all:all@localhost:8080' HTTP/1.1 200 OK curl -i -X GET 'http://all:all@localhost:8080' HTTP/1.1 403 Forbidden curl -i -X GET 'http://user:user@localhost:8080' HTTP/1.1 200 OK curl -i -X GET 'http://user:user@localhost:8080/_search' HTTP/1.1 200 OK curl -i -X POST 'http://user:user@localhost:8080/_search' HTTP/1.1 200 OK curl -i -X GET 'http://user:user@localhost:8080/_aliases' HTTP/1.1 200 OK curl -i -X POST 'http://user:user@localhost:8080/_aliases' HTTP/1.1 403 Forbidden curl -i -X POST 'http://user:user@localhost:8080/myindex/mytype/1' -d '{"title" : "Test"}' HTTP/1.1 403 Forbidden curl -i -X DELETE 'http://user:user@localhost:8080/myindex/' HTTP/1.1 403 Forbidden curl -i -X POST 'http://admin:admin@localhost:8080/myindex/mytype/1' -d '{"title" : "Test"}' HTTP/1.1 200 OK curl -i -X DELETE 'http://admin:admin@localhost:8080/myindex/mytype/1' HTTP/1.1 200 OK curl -i -X DELETE 'http://admin:admin@localhost:8080/myindex/' HTTP/1.1 200 OK ]]-- -- authorization rules local restrictions = { all = { ["^/$"] = { "HEAD" } }, user = { ["^/$"] = { "GET" }, ["^/?[^/]*/?[^/]*/_search"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/_msearch"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/_validate/query"] = { "GET", "POST" }, ["/_aliases"] = { "GET" }, ["/_cluster.*"] = { "GET" } }, admin = { ["^/?[^/]*/?[^/]*/_bulk"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/_refresh"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/?[^/]*/_create"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/?[^/]*/_update"] = { "GET", "POST" }, ["^/?[^/]*/?[^/]*/?.*"] = { "GET", "POST", "PUT", "DELETE" }, ["^/?[^/]*/?[^/]*$"] = { "GET", "POST", "PUT", "DELETE" }, ["/_aliases"] = { "GET", "POST" } } } -- get authenticated user as role local role = ngx.var.remote_user ngx.log(ngx.DEBUG, role) -- 1] Exit 403 when no matching role has been found if restrictions[role] == nil then ngx.header.content_type = 'text/plain' ngx.log(ngx.WARN, "Unknown role "..role) ngx.status = 403 ngx.say("403 Forbidden: You don\'t have access to this resource.") return ngx.exit(403) end -- get URL local uri = ngx.var.uri ngx.log(ngx.DEBUG, uri) -- get method local method = ngx.req.get_method() ngx.log(ngx.DEBUG, method) local allowed = false for path, methods in pairs(restrictions[role]) do -- path matched rules? local p = string.match(uri, path) local m = nil -- method matched rules? for _, _method in pairs(methods) do m = m and m or string.match(method, _method) end if p and m then allowed = true ngx.log(ngx.NOTICE, method.." "..uri.." matched: "..tostring(m).." "..tostring(path).." for "..role) end end ngx.log(ngx.NOTICE, "Allowed? "..tostring(allowed)) if not allowed then ngx.header.content_type = 'text/plain' ngx.log(ngx.WARN, "Role "..role.." not allowed to access the resource") ngx.status = 403 ngx.say("403 Forbidden: You don\'t have access to this resource.") return ngx.exit(403) end This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ # Generate passwords: # # $ printf "john:$(openssl passwd -crypt john)\n" >> passwords # $ printf "all:$(openssl passwd -crypt all)\n" >> passwords # $ printf "user:$(openssl passwd -crypt user)\n" >> passwords # $ printf "admin:$(openssl passwd -crypt admin)\n" >> passwords # # Install the Nginx with Lua support ("openresty"): # # $ wget http://openresty.org/download/ngx_openresty-1.4.3.9.tar.gz # $ tar xf ngx_openresty-* # $ cd ngx_openresty-* # $ # $ ./configure --with-luajit # $ # ./configure --with-luajit --with-cc-opt="-I/usr/local/include" --with-ld-opt="-L/usr/local/lib" # Mac OS X w/ Homebrew # $ make && make install # # More information: http://openresty.org/#Installation # # See the Lua source code in `authorize.lua` # # Run: # # $ /usr/local/openresty/nginx/sbin/nginx -p $PWD/nginx/ -c $PWD/nginx_authorize_by_lua.conf worker_processes 1; error_log logs/lua_error.log notice; events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; } server { listen 8080; location / { auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; access_by_lua_file '../authorize.lua'; proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" >> passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_allow_path_and_method.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; } server { listen 8080; server_name elasticsearch_proxy; error_log elasticsearch_proxy-errors.log; access_log elasticsearch_proxy.log; location / { error_page 590 = @elasticsearch; error_page 595 = @protected_elasticsearch; set $ok 0; if ($request_uri ~ ^/$) { set $ok "${ok}1"; } if ($request_method = HEAD) { set $ok "${ok}2"; } if ($ok = 012) { return 590; } return 595; } location @elasticsearch { proxy_pass http://elasticsearch; proxy_redirect off; } location @protected_elasticsearch { auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" >> passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_basic.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; } server { listen 8080; server_name elasticsearch_proxy; error_log elasticsearch_proxy-errors.log; access_log elasticsearch_proxy.log; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location / { proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # Generate password with eg. # # $ printf "john:$(openssl passwd -crypt s3cr3t)\n" >> passwords # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_deny_path.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; } server { listen 8080; server_name elasticsearch_proxy; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location / { if ($request_uri ~ _shutdown) { return 403; break; } proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,100 @@ # Generate passwords: # # $ printf "user:$(openssl passwd -crypt user)\n" >> users # $ printf "admin:$(openssl passwd -crypt admin)\n" >> admins # # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_http_auth_roles.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; } # Allow HEAD / for all # # curl -i -X HEAD 'http://localhost:8080' # HTTP/1.1 200 OK # # curl -i -X GET 'http://localhost:8080' # HTTP/1.1 403 Forbidden # server { listen 8080; server_name elasticsearch_all; location / { return 401; } location = / { if ($request_method !~ "HEAD") { return 403; break; } proxy_pass http://elasticsearch; proxy_redirect off; } } # Allow accessing /_search for authenticated "users" # # curl -i 'http://localhost:8081/_search' # HTTP/1.1 401 Unauthorized # # curl -i 'http://user:user@localhost:8081/_search' # HTTP/1.1 200 OK # # curl -i 'http://user:user@localhost:8081/_analyze?text=Test' # HTTP/1.1 200 OK # # curl -i 'http://user:user@localhost:8081/_cluster/health' # HTTP/1.1 403 Forbidden # server { listen 8081; server_name elasticsearch_users; auth_basic "Elasticsearch Users"; auth_basic_user_file users; location / { return 403; } location ~* /_search||_analyze { proxy_pass http://elasticsearch; proxy_redirect off; } } # Allow accessing everything for authenticated "admins" # # curl -i 'http://admin:admin@localhost:8082/_search' # HTTP/1.1 200 OK # # curl -i 'http://admin:admin@localhost:8082/_cluster/health' # HTTP/1.1 200 OK # server { listen 8082; server_name elasticsearch_admins; auth_basic "Elasticsearch Admins"; auth_basic_user_file admins; location / { proxy_pass http://elasticsearch; proxy_redirect off; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_keep_alive.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; keepalive 15; } server { listen 8080; server_name elasticsearch_proxy; location / { proxy_pass http://elasticsearch; proxy_http_version 1.1; proxy_set_header Connection "Keep-Alive"; proxy_set_header Proxy-Connection "Keep-Alive"; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # Run: # # $ nginx -p $PWD/nginx/ -c $PWD/nginx_round_robin.conf # events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9250; server 127.0.0.1:9251; } server { listen 8080; server_name elasticsearch_proxy; location / { proxy_pass http://elasticsearch; } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ john:C8Qf0PmsRcK7s all:gR9A3zOlFFRDs user:d.q1Wcp0KUqsk admin:/XyxrPc65koRY This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ user:laYuBcroEif0c -
karmi created this gist
Dec 17, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ nginx/ !nginx/.gitkeep !nginx/logs/.gitkeep src/ tmp/