Forum: NGINX Rewrite rule for reverse proxy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Claude (Guest)
on 2009-05-12 09:39
(Received via mailing list)
Hello.

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

I know I need to play with arguments and rewrite but I'm stuck.
Igor S. (Guest)
on 2009-05-12 10:33
(Received via mailing list)
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...
> to this one
> http://external_site.com/login?back_url=http%3A%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...
     http://external_site.com/login?back_url=http%3A%2F...
  ;
Claude (Guest)
on 2009-05-12 16:11
(Received via mailing list)
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...
>      http://external_site.com/login?back_url=http%3A%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...
This topic is locked and can not be replied to.