Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Elastic Search CORS Error [SOLVED]

Featured Replies

Failed to load http://localhost:9200/thirtybees11/_search: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://thirtybee.local' is therefore not allowed access.

  • Author

@lesley thirtybee.local is my local virtual host.

It sounds like then you need to set the cors policy of your local instance to be able to connect to your elastic instance. https://enable-cors.org/server_apache.html

  • Author

@lesley I did try this . Put the code in apache conf,virtual host as well as .htaccess still no luck .

I am not positive, but it might require a domain name being attached and then adding a content policy for the domain.

  • Author

@lesley I didn't get you. If you don't mind . Can you elaborate.

It looks like you are using localhost for your elastic instance, it might require you to use a domain name instead of a local host. @mdekker might be best suited to answer this one.

  • Author

@lesley You mean it will work fine on domain and not on local host. Thankyou.

I think lesley is right.

The issue here is you need to run it thrue Apache or Nginx in proxy, and make sure the config for that proxy has the right headers set for Access-Control-Allow-Origin.

Apache Header set Access-Control-Allow-Origin "*"

Nginx add_header 'Access-Control-Allow-Origin' '*';

Actually found some more info, it looks like in the configuration of Elasticsearch you can setup CORS to there is some more info about it on https://github.com/elastic/elasticsearch/issues/9031

  • Author

Setting http.cors.enabled : true http.cors.allow-origin : "*" In Elastic config located at config/elasticsearch.yml Fixed the Issue. But Now i am getting { "error":{ "root_cause":[ { "type":"illegal_argument_exception", "reason":"query malformed, empty clause found at [1:533]" } ], "type":"illegal_argument_exception", "reason":"query malformed, empty clause found at [1:533]" }, "status":400 }

Hmm revert back to the settings before you change, i think it's better to proxy it via nginx since Elastic Search can be a bit of a PITA.

  • Author

{ “error”:{ “rootcause”:[ { “type”:“illegalargumentexception”, “reason”:“query malformed, empty clause found at [1:533]” } ], “type”:“illegalargument_exception”, “reason”:“query malformed, empty clause found at [1:533]” }, “status”:400 } @lesley @mdekker Anyone

hmm in the elastic search module is the query missing there something sounds like it in my mind.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.