Like this?

get '/:x' => sub ($c) {
  $c->redirect_to('http://172.22.0.6:80/') if $c->param('x') eq 'foo';
  $c->redirect_to('http://172.22.0.7:80/') if $c->param('x') eq 'bar';
};

On Mon, Feb 7, 2022 at 9:27 AM Pavel Serikov <[email protected]>
wrote:

> I need to redirect requests to particular IP address depending on
> requested url.
>
> E.g.
> example.com/foo -> 172.22.0.6:80
> example.com/bar -> 172.22.0.7:80
> etc.
>
> Is it possible with Mojolicious out-of-the-box?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/1d5193e0-c1a0-4989-bdc4-282245d7626an%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/1d5193e0-c1a0-4989-bdc4-282245d7626an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFQZbmLdLsX5597v%2BhCe5K7XPXHtREOiu7mKTHukAFmDqQ%40mail.gmail.com.

Reply via email to