I want to maintain a dynamic database in Redis with SEO-friendly URLs as keys and nasty querystring URLs as values. I want to call this directly from Nginx when the request comes in, get the nasty querystring URL and pass that along to Apache to serve content.
I have thought about just having a flat map file, but that would be pretty huge (200,000+ entries) and it would have to be updated often by a cron job or something... not very elegant.
My idea is something like this:
map $uri $new {
# instead of this...
# include /path/to/the/nginx_map.txt;
# I want to do this...
redis_magic_thing GET $uri;
}
I have been checking out the HttpRedis Module for Nginx but the examples are really sparse and it seems more geared towards serving up cached content. I have also checked out the Redis2 module, but that seems like overkill. I just need to do plain old GET commands.
Can I use the HttpRedis module to do this and hook right into Redis? If so, what would such a configuration look like?
Thanks in advance for your help.
You are right about HttpRedis being more geared towards caching. You would be better served using the redis2 module. The commands you need to execute are better provided by the more general case that redis2 provides
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With