0

Here is my config:

location = /session {
            set $redis_key "$cookie_session";
            redis_pass 000.00.000.000:6379;
            echo $cookie_session;
            echo ' - ';
            echo $redis_key;
    }

The echos are there for testing purposes. And I hid the IP.

I am trying to get my sessions data from Redis via NGiNX. This is why I installed HttpRedis.

What I don't understand is how I can get the data from Redis then put it in a variable. So I can use it as I please.

jnbdz
  • 4,863
  • 9
  • 51
  • 93

1 Answers1

0

Use the NGiNX-Eval-Module: https://github.com/vkholodkov/nginx-eval-module

This is how you do it:

eval $var {
    set $redis_key $uri;
    redis_pass 000.00.000.000:6379;
}
jnbdz
  • 4,863
  • 9
  • 51
  • 93