FYI: How to do secondary indexing with Riak behind Nginx

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

FYI: How to do secondary indexing with Riak behind Nginx

Mårten Gustafson
Howdy,

= Background

During the Riak 1.0 webinar I played around with Nginx and encountered
a problem with secondary indexing when accessing Riak (over HTTP)
through Nginx. I had a quick chat with Sean about it on IRC[1] and
then I forgot it. The problem is that Nginx won't handle header names
with underscores "properly".

AFAICT it's perfectly legal with underscores in headers according to
RFC 2616[2], I also found a discussion on StackOverflow[3] that came
to the same conclusion.


= Solution

In your nginx.conf in the relevant server-section add the following:
underscores_in_headers on;



/mårten.

[1] http://irclogger.com/.riak/2011-09-21 @ 14:33
[2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
[3] http://stackoverflow.com/questions/964519/php-http-post-incorrect-headers

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: FYI: How to do secondary indexing with Riak behind Nginx

Alexander Sicular

That aside, I thought there were other reasons for not using nginx in front of riak. Http 1.0 vs http 1.1 support. For that reason I front Riak with haproxy.

Thoughts?

@siculars
http://siculars.posterous.com

Sent from my rotary phone.

On Oct 6, 2011 9:32 AM, "Mårten Gustafson" <[hidden email]> wrote:
> Howdy,
>
> = Background
>
> During the Riak 1.0 webinar I played around with Nginx and encountered
> a problem with secondary indexing when accessing Riak (over HTTP)
> through Nginx. I had a quick chat with Sean about it on IRC[1] and
> then I forgot it. The problem is that Nginx won't handle header names
> with underscores "properly".
>
> AFAICT it's perfectly legal with underscores in headers according to
> RFC 2616[2], I also found a discussion on StackOverflow[3] that came
> to the same conclusion.

>
>
> = Solution
>
> In your nginx.conf in the relevant server-section add the following:
> underscores_in_headers on;
>
>
>
> /mårten.
>
> [1] http://irclogger.com/.riak/2011-09-21 @ 14:33
> [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
> [3] http://stackoverflow.com/questions/964519/php-http-post-incorrect-headers
>
> _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: FYI: How to do secondary indexing with Riak behind Nginx

Jonathan Langevin
My understanding is the same as Alexander's. While I love nginx, I'll not be using it to proxy Riak until HTTP 1.1 is sorted out.


Jonathan Langevin
Manager, Information Technology

Loom Inc.
Wilmington, NC: (910) 241-0433 - [hidden email] - www.loomlearning.com - Skype: intel352



On Thu, Oct 6, 2011 at 9:49 AM, Alexander Sicular <[hidden email]> wrote:

That aside, I thought there were other reasons for not using nginx in front of riak. Http 1.0 vs http 1.1 support. For that reason I front Riak with haproxy.

Thoughts?

@siculars
http://siculars.posterous.com

Sent from my rotary phone.

On Oct 6, 2011 9:32 AM, "Mårten Gustafson" <[hidden email]> wrote:
> Howdy,
>
> = Background
>
> During the Riak 1.0 webinar I played around with Nginx and encountered
> a problem with secondary indexing when accessing Riak (over HTTP)
> through Nginx. I had a quick chat with Sean about it on IRC[1] and
> then I forgot it. The problem is that Nginx won't handle header names
> with underscores "properly".
>
> AFAICT it's perfectly legal with underscores in headers according to
> RFC 2616[2], I also found a discussion on StackOverflow[3] that came
> to the same conclusion.

>
>
> = Solution
>
> In your nginx.conf in the relevant server-section add the following:
> underscores_in_headers on;
>
>
>
> /mårten.
>
> [1] http://irclogger.com/.riak/2011-09-21 @ 14:33
> [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
> [3] http://stackoverflow.com/questions/964519/php-http-post-incorrect-headers
>
> _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: FYI: How to do secondary indexing with Riak behind Nginx

Jeff Kirkell
yep, that is the deal with nginx. That said, apparent nginx 1.1.5 had a bug fix for the ngx_http_proxy_module regarding http/1.1 but I am not sure if that means it solves the issue or relates to something else.

On Fri, Oct 7, 2011 at 5:14 PM, Jonathan Langevin <[hidden email]> wrote:
My understanding is the same as Alexander's. While I love nginx, I'll not be using it to proxy Riak until HTTP 1.1 is sorted out.


Jonathan Langevin
Manager, Information Technology

Loom Inc.
Wilmington, NC: <a href="tel:%28910%29%20241-0433" value="+19102410433" target="_blank">(910) 241-0433 - [hidden email] - www.loomlearning.com - Skype: intel352



On Thu, Oct 6, 2011 at 9:49 AM, Alexander Sicular <[hidden email]> wrote:

That aside, I thought there were other reasons for not using nginx in front of riak. Http 1.0 vs http 1.1 support. For that reason I front Riak with haproxy.

Thoughts?

@siculars
http://siculars.posterous.com

Sent from my rotary phone.

On Oct 6, 2011 9:32 AM, "Mårten Gustafson" <[hidden email]> wrote:
> Howdy,
>
> = Background
>
> During the Riak 1.0 webinar I played around with Nginx and encountered
> a problem with secondary indexing when accessing Riak (over HTTP)
> through Nginx. I had a quick chat with Sean about it on IRC[1] and
> then I forgot it. The problem is that Nginx won't handle header names
> with underscores "properly".
>
> AFAICT it's perfectly legal with underscores in headers according to
> RFC 2616[2], I also found a discussion on StackOverflow[3] that came
> to the same conclusion.

>
>
> = Solution
>
> In your nginx.conf in the relevant server-section add the following:
> underscores_in_headers on;
>
>
>
> /mårten.
>
> [1] http://irclogger.com/.riak/2011-09-21 @ 14:33
> [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
> [3] http://stackoverflow.com/questions/964519/php-http-post-incorrect-headers
>
> _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com