how to config cross domain support for fluentd?

199 views
Skip to first unread message

Blackwing Zhong

unread,
Jan 13, 2015, 10:57:48 PM1/13/15
to flu...@googlegroups.com
I found that some logs were missed, maybe it's the cross domain problem.
how to config cross domain support for fluentd?

Kiyoto Tamura

unread,
Jan 13, 2015, 11:06:39 PM1/13/15
to flu...@googlegroups.com
I assume this is for in_http.

Actually, support for it was added (at least in v0.10.58 and above) with "cor_allow_origins". You pass it an array of allowed origins like this:

<source>
  type http
  cors_allow_origins ["origin1", "origin2"]
</source>

Kiyoto

p.s. this should be documented. I will add it to the docs soon.

On Tue, Jan 13, 2015 at 7:57 PM, Blackwing Zhong <blackwi...@gmail.com> wrote:
I found that some logs were missed, maybe it's the cross domain problem.
how to config cross domain support for fluentd?

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Check out Fluentd, the open source data collector to unify log management.

Blackwing Zhong

unread,
Jan 14, 2015, 3:53:57 AM1/14/15
to flu...@googlegroups.com
Thank you for you quick response.
Can you detail the usage of it? Such as how to config wildcard domain

在 2015年1月14日星期三 UTC+8下午12:06:39,kiyoto写道:

Olli Kaven

unread,
Feb 11, 2015, 6:00:54 AM2/11/15
to flu...@googlegroups.com
Should this enable sending POST request from another domain? I'm still getting  No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.example.com' is therefore not allowed access. The response had HTTP status code 400.

My config line:  cors_allow_origins ["domain1", "http://www.example.com"]

And the request:
(function() {
  var data = JSON.stringify({ 'name': 'John Rambo' });  

  var xhr = new XMLHttpRequest();
  xhr.open('POST', '//mydomain.com:10888/myapp.test', true);
  xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');

  // send the collected data as JSON
  xhr.send(data);

  xhr.onloadend = function () {
    // done
  };

})()

Mr. Fiber

unread,
Feb 11, 2015, 8:35:22 AM2/11/15
to flu...@googlegroups.com
Hmm... I'm not familier with CORS.
Should in_http return some HTTP headers to the client?


Masahiro

Olli Kaven

unread,
Feb 12, 2015, 2:42:14 AM2/12/15
to flu...@googlegroups.com
Yep, the Access-Control-Allow-Origin. 

Mr. Fiber

unread,
Feb 12, 2015, 11:33:41 AM2/12/15
to flu...@googlegroups.com
Hmm... I see.
I'm not sure why this author sends the patch to fluentd core.
I want a patch to support CORS correctly with in_http.


Masahiro

Mr. Fiber

unread,
Feb 12, 2015, 11:34:06 AM2/12/15
to flu...@googlegroups.com
 this author sends the patch to fluentd core.

This author doesn't send the patch to fluentd core.

Mr. Fiber

unread,
Feb 12, 2015, 11:46:22 AM2/12/15
to flu...@googlegroups.com
Ah, I found this issue.


The author has a plan to send PR to fluentd :)


Olli Kaven

unread,
Feb 13, 2015, 2:35:05 AM2/13/15
to flu...@googlegroups.com
Great!
Reply all
Reply to author
Forward
0 new messages