-
Notifications
You must be signed in to change notification settings - Fork 126
Is it postgres_set works? #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Regarding It is still possible to use value received from PostgreSQL database like in your example, you'll just need to combine ngx_postgres with agentzh's fork of eval module:
Please note that eval module currently doesn't work with nginx-0.8.42, so you'll need to use older version of nginx. Also, depending on your real use case, you might want to use ngx_http_auth_request_module or ngx_lua instead. Regarding Again, you can combine ngx_postgres with any of the modules mentioned above to Hope this clarify things. |
I have nginx 0.7.67 installed on freebsd. I compile nginx with both postgres and agentzh-eval modules. I have tried first variant: location ~* ^.*-art-(\S).html$ {
} But the result was same. $id was empty in rewrite. I put /ads/ad-.html and it was showed. I want to build smart cache with postgres and ssi module. The simple db request should return ad id and then it should be located on the disk by $id. |
Sorry, I was wrong. You cannot use However, you can do something like:
or what is probably even better solution (but requires writing stored procedure in PostgreSQL):
Otherwise you should wait until ngx_lua will allow |
I have tried exactly right this |
Does this query return anything for you? Because if it doesn't then I've just created
Accessing |
thank you for answer, too sad it doesn`t work for me |
I was able to get this working with the following stack:
Url trigger
|
I had tried this configuratio for my project:
postgres_pass database;
postgres_query "SELECT id FROM articles WHERE slug='$slug' LIMIT 1";
postgres_set $id 0 0;
postgres_output none;
When i try to use $id for rewrite operator it returns nothing:
rewrite ^/(.*)$ /$id permanent; => redirects to "/" but not /$id
When i try echo it, it returns nothing:
echo "id = '$id'"; => id=''
But when i try example from your tests with header, it works:
add_header "X-ID" $id;
Why it is? Why i can`t get variable value?
The text was updated successfully, but these errors were encountered: