Welcome! Log In Create A New Profile

Advanced

Re: rewrite / proxy_pass different bahaviour in 1.0 and 1.2

Maxim Dounin
September 28, 2012 02:00PM
Hello!

On Fri, Sep 28, 2012 at 11:36:49AM -0400, alexey.radkov wrote:

> Hi guys.
>
>
> Is the following result of a bug fix in proxy module in 1.2 series?
>
> Imagine following config (sorry, i do not know how to format it here):

[...]

> location /test.html {
> rewrite ^ /Internal_test last;
> }
>
> location /Internal_test {
> internal;
> proxy_pass http://$arg_a;
> }
> }

[...]

> and following request:
>
> curl 'http://localhost:8010/test.html?a=ubackend'

[...]

> So the difference is that in 1.0 original URI is not rewritten in HTTP GET
> header when proxied after rewrite, but in 1.2 it is rewritten to
> /Internal_test thus giving result 404 Not Found.
>
>
> Do I understand this right that 1.0 behaviour was not correct and just fixed
> in 1.2?

Yes. This was fixed 1.1.12:

*) Bugfix: a "proxy_pass" directive without URI part always used
original request URI if variables were used.

> To achieve 1.0 behaviour in 1.2 i can add only 2 lines of code from 1.0.

You may also use

proxy_pass http://$arg_a$request_uri;

to get the old behaviour.

[...]

--
Maxim Dounin
http://nginx.com/support.html

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

rewrite / proxy_pass different bahaviour in 1.0 and 1.2

alexey.radkov September 28, 2012 11:36AM

Re: rewrite / proxy_pass different bahaviour in 1.0 and 1.2

Maxim Dounin September 28, 2012 02:00PM

Re: rewrite / proxy_pass different bahaviour in 1.0 and 1.2

alexey.radkov September 29, 2012 09:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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