Forum: NGINX $args getting cleared out when using memcached module. Bug?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1f63dadb857637a35df3fa553f67a5a7?d=identicon&s=25 jturmel (Guest)
on 2009-03-26 22:47
(Received via mailing list)
We're having some really weird issues when trying to pass $args to the
memcached
module.

Here is a snippet.

set $memcached_key $uri$is_args$args;
memcached_pass 127.0.0.1:11211;
error_page 404 = @fallback;

It will pass in $uri$is_args, which in our case is "/index.php?"

If we comment out the 3 lines with memcached stuff and do the following:

add_header "test" $uri$is_args$args;

You can see the entire value just fine.  It seems to be a bug in the way
the
module interacts with Nginx but we can't nail it down.  We added a debug
line at
the very beginning of the memcached module and it seems to be empty as
soon as
it is called.

This seems to be a bug with all the extensive testing and configurations
we've
tried.

Thank you,
Josh
1f63dadb857637a35df3fa553f67a5a7?d=identicon&s=25 Josh Turmel (Guest)
on 2009-03-27 01:13
(Received via mailing list)
We have messed with it some more and have more information.

Basically our 2 request might look like the following, we have
discovered the
first example works, while the second example does not.

Example 1:
http://api.examplesite.com/1.0/bible/chapter.xml?r...

This will get rewritten to:

api.examplesite.com/index.php?api_version=1.0&call=bible/chapter&reference=rev.22

This call works we found out, now for the next example (example 2) that
does not
work and results in the key being sent to memcached as "/index.php?"
missing the
$args portion:

Example 2: http://api.examplesite.com/1.0/bible/chapter.xml

This gets rewritten in Nginx as:

api.examplesite.com/index.php?api_version=1.0&call=bible/chapter


What we have deduced is that if the initial request entering Nginx has
args then
the $args are properly passed when we set $memcached_key
($uri$is_args$args) but
when the initial request (ie Example 2) does not have args, they are
empty, even
though we have rewritten the request.

One odd note though is that $is_args is set properly, so this seems to
be
exclusive to $args.

Hope this helps.

Thank you,
Josh
This topic is locked and can not be replied to.