How to set multi value about http.cors.allow-origin in es 5.x

(andy_zhou) #1

how to set http.cors.allow-origin in es
when i wan't to only two ip can use elasticsearch-head connect to es?
how can set teh http.cors.allow-origin
this is one ip http.cors.allow-origin: /https?://localhost(:[0-9]+)?/
how about two ip settings?

(andy_zhou) #2

some on can help me ?

(andy_zhou) #3

can solve it

(andy_zhou) #4


(Alexander Reelsen) #5

Please see the documentation - if you prepend and append a / then the value is treated as a regular expression. You need to create a regular expression that matches your two hosts.

(andy_zhou) #6

yes.i know, but i don't know how to create a regular expression that matches two hosts.
can give me a example

(andy_zhou) #7

is linke this http.cors.allow-origin: /https?://localhost(:[0-9]+)?/http?://[0-9]+)?

(Alexander Reelsen) #8

try something like https?:\/\/(localhost|[0-9]+)? (fully untested, you should go with some regex tester first and then see if the regex is doing what you expect)

(andy_zhou) #9

this slove it.

(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.