From bbd742c99226712c5d333d73a35d8e871b1baa8c Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 12 Nov 2015 09:54:32 -0800 Subject: [PATCH] Add config options for cors config With newer ES we need to set CORS controls properly because it seems to care about that now. This change allows you to enable the use of CORS and specify which origins are allowed. By default ES doesn't allow any cross origin requests so you have to explicitly enable it with these options if you want to allow it. Change-Id: I0aa8d5167c770c1024b7596da582d6cc089b1b47 --- templates/elasticsearch.yml.erb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/elasticsearch.yml.erb b/templates/elasticsearch.yml.erb index 6470e48..e79c29a 100644 --- a/templates/elasticsearch.yml.erb +++ b/templates/elasticsearch.yml.erb @@ -263,6 +263,13 @@ bootstrap.mlockall: <%= @es_template_config['bootstrap.mlockall'] %> # # http.enabled: false +<% if es_template_config.has_key?('http.cors.enabled') then -%> +http.cors.enabled: <%= es_template_config['http.cors.enabled'] %> +<% end -%> + +<% if es_template_config.has_key?('http.cors.allow-origin') then -%> +http.cors.allow-origin: <%= es_template_config['http.cors.allow-origin'] %> +<% end -%> ################################### Gateway ###################################