Giter Club home page Giter Club logo

Comments (18)

agentzh avatar agentzh commented on August 16, 2024 6

@onnimonni Hmm, seems like it's the time for OpenResty to fork it :)

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024 2

@onnimonni OK, maybe we can create an openresty/redis-nginx-module repository as the fork of the original module.

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024 1

@ksbomj OK, you are referring to ngx_redis. Well, you'll have to ask the author of ngx_redis instead. The ngx_srcache module is an old tech developed 5+ years ago. We're planning a much much better cache software based on OpenResty that can even serve CDN scale networks very well.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024 1

@agentzh the author if ngx_redis didn't move forward with this after I notified him about the issue last year.

The problem is that the version I mentioned above: https://github.com/Yongke/ngx_http_redis-0.3.7 is based on a bit older version. (Newest one is 0.3.8).

Would you accept a new forked version of ngx_redis module as part of openresty suite if I use Yongke's patches and apply them for the original 0.3.8?

I would want to include it in here and I can ask nginx if they would want to use and link to that version instead of the current one.

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024

@onnimonni Both ngx_redis and ngx_redis2 should support passwords. Please read their official documentation more carefully.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

Thanks for your help!

I think I have read through them a hundred times already, but what I missed was the following redis command: http://redis.io/commands/AUTH.

I will try this soon but does the authentication work like this?

location = /redis2 {
     internal;

     set_unescape_uri $exptime $arg_exptime;
     set_unescape_uri $key $arg_key;
     set_md5 $key;

     redis2_query auth $password; <----- Use the password here
     redis2_query set $key $echo_request_body;
     redis2_query expire $key $exptime;
     redis2_pass 127.0.0.1:6379;
 }

I think I missed the following one?

redis2_query
Multiple instances of this directive are allowed in a single location and these queries will be pipelined.
https://github.com/openresty/redis2-nginx-module#redis2_query

Side topic:
If I use this with docker container enviroment variables is the preferred way to read the configuration like this:

set_by_lua $redis_host 'os.getenv("REDIS_HOST")';
set_by_lua $redis_pass 'os.getenv("REDIS_PASSWORD")';
set_by_lua $redis_port 'os.getenv("REDIS_PORT")';

Is there better ways than this?

Thanks in advance! Thanks for creating such useful tools :)!

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

And I did also read the ngx_redis readme: https://www.nginx.com/resources/wiki/modules/redis/#variables

And I can't really figure it out.

There's only mention of these two variables:

$redis_key - The value of the redis key.

$redis_db - The number of redis database (required for < 0.3.4).

But no mentioning about pipelines or arguments or anyway to provide the AUTH 😞.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

I managed to do this finally using this fork of the redis module: https://github.com/Yongke/ngx_http_redis-0.3.7

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024

@onnimonni Oh, I didn't know the official ngx_redis module does not support auth variables. Will you ask the original author of ngx_redis to add support for it? Many thanks!

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

Np! I'll report this to nginx.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

This can be tracked over here: https://trac.nginx.org/nginx/ticket/1120#ticket

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024

I am afraid you are reporting to the wrong place. ngx_redis is not a standard nginx module but a 3rd party module. You should contact the author of that module instead of the official nginx team.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

You are right and I contacted the ngx_http_redis module author: [email protected].

I'm afraid that he's not actively developing this module anymore.

from srcache-nginx-module.

onnimonni avatar onnimonni commented on August 16, 2024

That would be excellent :)! Can you update this thread when that happens? Then I can again use the redis module bundled in openresty package.

from srcache-nginx-module.

ksbomj avatar ksbomj commented on August 16, 2024

Hi guys! Is there any stable version that support redis auth?

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024

@ksbomj It's been supported in stable releases of ngx_redis2 for 5+ years already. I wonder why you are asking.

from srcache-nginx-module.

wyvern8 avatar wyvern8 commented on August 16, 2024

Hi @agentzh , i'm looking at options for caching of upstream responses, and was considering this module. I saw your comment :

"The ngx_srcache module is an old tech developed 5+ years ago. We're planning a much much better cache software based on OpenResty that can even serve CDN scale networks very well."

Got any more info on this? My project is already built on OpenResty (which is great btw), and im just using the "X-Accel-Expires" header and caching in a second downstream OpenResty nginx at the moment. https://github.com/wyvern8/akamai-nginx

from srcache-nginx-module.

agentzh avatar agentzh commented on August 16, 2024

@wyvern8 That would become a commercial cache software provided by OpenResty Inc:

https://openresty.com/

from srcache-nginx-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.