Re: rewrite last using variable

2013-10-28 Thread Francis Daly
On Mon, Oct 28, 2013 at 09:36:20AM +0100, Ingo Schmidt wrote: Hi there, I was (partly) wrong when I said """ > I guess that the URL encoding also takes place in the first case, but > here the client decodes the URL and thus everything is ok again. No; here what is sent to the client includes t

Re: rewrite last using variable

2013-10-28 Thread Ingo Schmidt
Hi! I believe it is intended to be "no", for internal rewrites at least. Hmm, any reason why it might be intended? Also, it would be nice if the docs could mention this, because I find it unintuitive, if rewrite behaves differently depending on the rewrite type. You can do something like set

Re: rewrite last using variable

2013-10-28 Thread Francis Daly
On Mon, Oct 28, 2013 at 01:56:16AM +0100, Ingo Schmidt wrote: Hi there, > set $var "/url?par=val"; > location = /b { > rewrite ^ $var last; > } > For location b the redirect is internal and now the backend cannot > process the request anymore. > I guess that the URL encoding also takes pla

rewrite last using variable

2013-10-27 Thread Ingo Schmidt
Hi, consider the following simplified nginx config snippet: set $var "/url?par=val"; location = /a { rewrite ^ $var redirect; } location = /b { rewrite ^ $var last; } location = /url { proxy_pass http://some_backend; } For location a the redirect goes via the client and everything w