Rewrite rule for reverse proxy

Hello.

Trying to write a rewrite rule that will transform this url
http://external_site.com/login?back_url=http%3A%2F%2Finternal_url%2F
to this one
http://external_site.com/login?back_url=http%3A%2F%2Fexternal_site.com%2F

I know I need to play with arguments and rewrite but I’m stuck.

On Tue, May 12, 2009 at 03:58:31AM +0000, Claude wrote:

Trying to write a rewrite rule that will transform this url
http://external_site.com/login?back_url=http%3A%2F%2Finternal_url%2F
to this one
http://external_site.com/login?back_url=http%3A%2F%2Fexternal_site.com%2F

I know I need to play with arguments and rewrite but I’m stuck.

Redirection rewrite capabilitires are very limited: they works with
exact strings only, but you may try

proxy_redirect default;

proxy_redirect
http://external_site.com/login?back_url=http%3A%2F%2Finternal_url%2F
http://external_site.com/login?back_url=http%3A%2F%2Fexternal_site.com%2F
;

Igor S. <is@…> writes:

Redirection rewrite capabilitires are very limited: they works with
exact strings only, but you may try

proxy_redirect default;

proxy_redirect
http://external_site.com/login?back_url=http%3A%2F%2Finternal_url%2F
http://external_site.com/login?back_url=http%3A%2F%2Fexternal_site.com%2F
;

Hum, not exactly what I’m looking for as I don’t know in advance how
many pages
will use the string “internal_site” and also the parameter can be
something
else. It would be nice to have something similar to the substitution
module for
uri…