Rewrite rule for reverse proxy

Igor Sysoev is at rambler-co.ru
Tue May 12 10:23:46 MSD 2009


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 Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list