Welcome! Log In Create A New Profile

Advanced

Re: ngx_lua + proxy_next_upstream

Yichun Zhang (agentzh)
September 24, 2013 04:30PM
Hello!

On Tue, Sep 24, 2013 at 2:35 AM, Jedrzej Nowak wrote:
>
> The question is how can I do NOT redirect ?

Well, "rewrite ... break" is not a redirect. It is just an internal
URI rewrite. That's all.

> I tried with @test instead of
> /test but no success. Is there any other way to do that ?
>

Named locations can only work with internal redirects. They do not
support Nginx subrequests. You can ask the Nginx team to add support
for that to the Nginx core.

> [...]
> ngx.var.upstream = "192.168.1.10:9999"
> res = ngx.location.capture('/test' .. ngx.var.request_uri,
> {share_all_vars = true})
> [...]
>

Please note that setting the "share_all_vars" to true for your
subrequests are genreally a bad idea. Because there could be really
bad side effects. In your example, all you need is to enable the
"copy_all_vars" option.

BTW, you may want to post such questions to the openresty-en mailing
list instead:

https://groups.google.com/group/openresty-en

Best regards,
-agentzh

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

ngx_lua + proxy_next_upstream

Jedrzej Nowak September 18, 2013 09:10AM

Re: ngx_lua + proxy_next_upstream

Yichun Zhang (agentzh) September 19, 2013 08:36PM

Re: ngx_lua + proxy_next_upstream

Jedrzej Nowak September 23, 2013 03:18AM

Re: ngx_lua + proxy_next_upstream

Jedrzej Nowak September 24, 2013 05:36AM

Re: ngx_lua + proxy_next_upstream

Yichun Zhang (agentzh) September 24, 2013 04:30PM

Re: ngx_lua + proxy_next_upstream

Anonymous User September 24, 2013 06:40PM

Re: ngx_lua + proxy_next_upstream

Yichun Zhang (agentzh) September 25, 2013 02:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 318
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