Welcome! Log In Create A New Profile

Advanced

Re: Nginx postgres problem

Yichun Zhang (agentzh)
March 05, 2014 03:04PM
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 } );
> ';
>

Forgot to mention that redirects in a subrequest won't affect its
parent requests. They're separate requests anyway. Try thinking about
it :)

Use either ngx.req.set_uri() or ngx.exec() in rewrite_by_lua. (If you
use content_by_lua, then you can only use ngx.exec for internal
redirects).

See

https://github.com/chaoslawful/lua-nginx-module#ngxreqset_uri

https://github.com/chaoslawful/lua-nginx-module#ngxexec

Also, it is a bad idea to enable "share_all_vars" due to potential bad
side-effects that lead to weird issues that are extremely hard to
debug. Just share the NGINX variables you want to share.

Best regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx postgres problem

arunh March 04, 2014 10:15AM

Re: Nginx postgres problem

Yichun Zhang (agentzh) March 04, 2014 06:20PM

Re: Nginx postgres problem

arunh March 05, 2014 11:39AM

Re: Nginx postgres problem

Yichun Zhang (agentzh) March 05, 2014 03:00PM

Re: Nginx postgres problem

Yichun Zhang (agentzh) March 05, 2014 03:04PM

Re: Nginx postgres problem

arunh March 05, 2014 05:21PM

Re: Nginx postgres problem

Yichun Zhang (agentzh) March 05, 2014 05:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 283
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready