# Can we redirect before going to final backend?

**URL:** <https://discourse.haproxy.org/t/can-we-redirect-before-going-to-final-backend/4598>\
**Category:** Help!\
**Created:** [December 5, 2019, 1:33pm UTC](https://discourse.haproxy.org/t/can-we-redirect-before-going-to-final-backend/4598 "2019-12-05T13:33:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwrty](https://avatars.discourse-cdn.com/v4/letter/q/f1d935/32.png) [@qwrty](https://discourse.haproxy.org/u/qwrty)\
**Post date:** [December 5, 2019, 1:33pm UTC](https://discourse.haproxy.org/t/can-we-redirect-before-going-to-final-backend/4598/1 "2019-12-05T13:33:51Z")

</div>

Hey folks,

I would like to know if I can make a redirection to a specific server, before handle the redirection to final backend ?

I will try to explain better with an example:

Here my condition:  
use\_backend plex if { hdr\_beg(Host) -i plex. }

here my backend:  
backend plex  
server plex 127.0.0.1:32400 check

basic content delivering, working great.

I would like to make a sort of announce to the user and redirect him to a temporary web page on my server then redirect to the backend.

Is this possible with haproxy ?

Thank you

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [December 11, 2019, 8:52am UTC](https://discourse.haproxy.org/t/can-we-redirect-before-going-to-final-backend/4598/2 "2019-12-11T08:52:04Z")

</div>

Hi,

No, you can’t do this directly.  
What you can do is to route to that “information” server in case the client does not have a cookie or a url param or a whatever indicating it has never seen the information page.  
Then, if a client comes in, you can easily spot if he got already redirected to that information message or not.

---

<div class="post-metadata">

**Author:** ![qwrty](https://avatars.discourse-cdn.com/v4/letter/q/f1d935/32.png) [@qwrty](https://discourse.haproxy.org/u/qwrty)\
**Post date:** [December 12, 2019, 11:40am UTC](https://discourse.haproxy.org/t/can-we-redirect-before-going-to-final-backend/4598/3 "2019-12-12T11:40:06Z")

</div>

Thank you, I guess your refer to this:

> [@HAProxy URL + cookies Based routing with load balancing](https://discourse.haproxy.org/t/haproxy-url-cookies-based-routing-with-load-balancing/2500):
>
> I have 2 server witch run behind HaProxy Load balancer. Here scenario is that application opens new popup window and it doesn’t carry forward parent cookies in pop up window, so it doesn’t know which back-end server will serve the request, so we have planned to pass it in URL like for initial request Next request which comes after this will have the SERVERID as cookie, so here default haproxy backend will take care where to send the request example. com/?balancer=app1 (This request should go …

?
