I am trying to set up Nginx caching with multiple servers using a shared Redis instance for storage. I am using the HttpSRCacheModule, along with HttpRedis2Module.
In the example configuration, both HttpRedisModule and HttpRedis2Module are in use. HttpRedis2Module used for writing to Redis, while HttpRedisModule is used for reading. The reason for this is that HttpRedis2Module only returns the raw data from Redis, rather than the value of the key I am trying to access. To clarify, half of the Redis wire protocol is included in the output of this module, which completely breaks its usage in Nginx to retrieve values.
This doesn't make a lot of sense to me. I'm not sure why this extension would be built in a way that prevents it from being used... so I am thinking that I am missing something. Is it possible to use the HttpRedis2Module to read a key from Redis and return its value to the HTTP client?
If you're wondering why I don't use HttpRedisModule like it is used in the example configuration, it is that I can't get it compiled for Nginx 1.6.0. There seeems to be some sort of compatibility issue. Others have suggested simply using the OpenResty bundle, but I am avoiding that route for the time being since you seemingly can't build OpenResty with your own Nginx configure parameters. With the locations of all the config files and what not changing, I have a lot of automation and scripts that would need to be updated. I may go with OpenResty in the end, but I would like to definitively answer the question of reading from Redis with HttpRedis2Module first.
Any suggestions would be great. Thanks!
0 Answers