can i do the following:
check memcache for existence of content.
if not continue our normal processing which is currently:
check for static file
if it exists, serve it
if it doesnt exist, pass request off to upstream server.
can i do the following:
check memcache for existence of content.
if not continue our normal processing which is currently:
check for static file
if it exists, serve it
if it doesnt exist, pass request off to upstream server.
On Thu, Feb 28, 2008 at 05:09:18PM -0500, Sean A. wrote:
can i do the following:
check memcache for existence of content.
if not continue our normal processing which is currently:
check for static file
if it exists, serve it
if it doesnt exist, pass request off to upstream server.
The checking local file is faster than memcached, so:
location / {
error_page 404 = @memcache;
}
location @memcache {
set $memcached_key "$uri?$args";
memcached_pass ...
recursive_error_pages on;
error_page 404 = @upstream;
}
location @upstream {
proxy_pass ...
error_page 404 = @upstream;
}
On Feb 29, 2008, at 11:28 AM, Igor S. wrote:
if it doesnt exist, pass request off to upstream server.
recursive_error_pages on; error_page 404 = @upstream; } location @upstream { proxy_pass ... error_page 404 = @upstream; }
Well, this will serve from local file system and memcache but it isnt
passing to the upstream.
just get an nginx 404 if it can find in local file system or memcache.
if i get that worked out, is there a way to have it just move on to
the upstream if the memcache is
down instead of returning a 502?
On Feb 29, 2008, at 1:25 PM, Sean A. wrote:
location @memcache {
error_page 404 = @upstream;
}
I think I might have this working by moving recursive_error_pages
on; into my server { } defs.this should fill my error log with tons of error messages correct?
well ok so far, it works partially. got the 502 error figured out.
any code that does a redirect, results in 405 error.
been digging for an answer. any ideas?
also is there a way to not have all these requests end up in the error
log as file not found?
On Feb 29, 2008, at 11:28 AM, Igor S. wrote:
if it doesnt exist, pass request off to upstream server.
recursive_error_pages on; error_page 404 = @upstream; } location @upstream { proxy_pass ... error_page 404 = @upstream; }
I think I might have this working by moving recursive_error_pages on;
into my server { } defs.
this should fill my error log with tons of error messages correct?
On Feb 29, 2008, at 2:02 PM, Sean A. wrote:
check memcache for existence of content.
error_page 404 = @memcache;location @upstream {
proxy_pass …error_page 404 = @upstream;
}
Sorry for the noise. Managed to work through a number of things myself
with some help from google and dumb luck.
Routing all POST requests away from the error_page 404 = @memcache;
took care of the 405 issue.
Questions I have left:
is there a way to hash the “$uri?$args” with something like md5 to
keep a really long arg string from
going beyond the max memcache key size?
is there a way to selectively not log the file not found errors that
using error_page to redirect creates
while at the same time preserving ‘real’ errors?
Thanks for all the help you have already given on this Igor. I wouldnt
have come close to getting this
near to done without your assistance.
On Fri, Feb 29, 2008 at 12:58:42PM -0500, Sean A. wrote:
location @memcache {
error_page 404 = @upstream;
This error_page was unneeded.
}
Well, this will serve from local file system and memcache but it isnt
passing to the upstream.
just get an nginx 404 if it can find in local file system or memcache.
“recursive_error_pages on” should pass request to error_page hanlder.
if i get that worked out, is there a way to have it just move on to
the upstream if the memcache is
down instead of returning a 502?
error_page 404 = @upstream;
error_page 404 502 504 = @upstream;
On Fri, Feb 29, 2008 at 03:19:35PM -0500, Sean A. wrote:
The checking local file is faster than memcached, so:
Sorry for the noise. Managed to work through a number of things myself
with some help from google and dumb luck.Routing all POST requests away from the error_page 404 = @memcache;
took care of the 405 issue.
ngx_http_memcached_module does not support POST now.
It seems there should be “memcached_post” like “static_post”.
Or event allow POST to memcached by default.
Questions I have left:
is there a way to hash the “$uri?$args” with something like md5 to
keep a really long arg string from
going beyond the max memcache key size?
No.
is there a way to selectively not log the file not found errors that
using error_page to redirect creates
while at the same time preserving ‘real’ errors?
What error types do you want to hide ?
On Fri, Feb 29, 2008 at 03:58:39PM -0500, Sean A. wrote:
thepinkpatch.co.uk/public/s-TPP/lp" failed (2: No such file or
directory), client: 90.208.166.236, server: micro.thepinkpatch.co.uk,
request: “GET /s-TPP/lp HTTP/1.1”, host: “micro.thepinkpatch.co.uk”which are the result of using error page to pass over to our upstreams.
location / {
log_not_found off;
}
is there a way to selectively not log the file not found errors that
using error_page to redirect creates
while at the same time preserving ‘real’ errors?What error types do you want to hide ?
these:
2008/02/29 20:57:30 [error] 25532#0: *6135062 open() “/ah/sites/
thepinkpatch.co.uk/public/s-TPP/lp” failed (2: No such file or
directory), client: 90.208.166.236, server: micro.thepinkpatch.co.uk,
request: “GET /s-TPP/lp HTTP/1.1”, host: “micro.thepinkpatch.co.uk”
which are the result of using error page to pass over to our upstreams.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs