Hello!
On Wed, Mar 5, 2014 at 2:21 PM, arunh wrote:
> Depending on the parameters a,b,c and d I will get the IP and port of the
> destination server (by communicating with postgres) where the request must
> be redirected to ie the new url is of the form:
> http://IP:port/a/b/c/d.
>
You need eithe
Hello Yichun,
The use case I am trying to test is the client sends a request to nginx
server with some parameters say "/a/b/c/d":
http://NginxHost/a/b/c/d
Depending on the parameters a,b,c and d I will get the IP and port of the
destination server (by communicating with postgres) where the reques
Hello!
On Wed, Mar 5, 2014 at 8:39 AM, arunh wrote:
> location /postgresrewrite
> {
>rewrite ^ "http://$nodeIP:$port/$inputURI";;
> }
>
[...]
>rewrite_by_lua '
>res5=ngx.location.capture(
> "/postgresrewrite", { share_all_vars = true } );
>
Hello!
On Wed, Mar 5, 2014 at 8:39 AM, arunh wrote:
> I had to make a series of postgres calls so I used content_by_lua along by
> sharing the varialbes as I had to query tables from multiple databases.
>
No, you should use rewrite_by_lua exclusively for all the
ngx.location.capture calls here I
Hello Yichun,
Thank you very much for the reply.
I have used ngx.location.capture for extracting the values from postgres
database as suggested by you.
I had to make a series of postgres calls so I used content_by_lua along by
sharing the varialbes as I had to query tables from multiple databases
Hello!
On Tue, Mar 4, 2014 at 7:15 AM, arunh wrote:
> But when I try to print the value of "$1" variable and also after assigning
> it to the variable "$tenantID" I do get the value.
> I guess in the eval block the postgres_escape is not getting set.
>
The "eval" directive always runs before the
Hello All,
I am newbie to Nginx and I am using Nginx with PostgreSQL database.
When there is a http request to the server I want to extract one of the
input variables in the request,
query the Database and retrun the result, the variable inside the
postgres_query is empty.
But when I try to prin