# Haproxy backend

**URL:** <https://discourse.haproxy.org/t/haproxy-backend/4912>\
**Category:** Help!\
**Created:** [February 28, 2020, 6:17pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912 "2020-02-28T18:17:54Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 3, 2020, 8:26pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/21 "2020-03-03T20:26:55Z")

</div>

> [@aarathy53](#):
>
> so user req hits the lb at 80

It’s HTTPS. You mean port 443, right?

Or is really `https://ab.com:80/abc` that you put in the browser address bar?

> [@aarathy53](#):
>
> SSL termination is handled at the f5 LB itself

And what does the F5 do with the Host header?

I’d suggest you tcpdump a HTTP request arriving at the haproxy instance, so you can checkout the actual Host header, and put whatever you need into the haproxy configuration.

None of this is haproxy related though. You just need to understand what Host header to expect from your infrastructure.

---

<div class="post-metadata">

**Author:** ![aarathy53](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aarathy53](https://discourse.haproxy.org/u/aarathy53)\
**Post date:** [March 3, 2020, 8:43pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/22 "2020-03-03T20:43:19Z")

</div>

The url will be accessed through the url [https://abc.com:9000](https://abc.com:9000) ,as i said before 9000 is mapped to 8080 of Hap when it is initialised as docker container.

Any idea what http\_request:GET /abc HTTP/1.1 at hap logs mean ?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 3, 2020, 8:49pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/23 "2020-03-03T20:49:27Z")

</div>

Then that is what you need to put into your ACL:

```
redirect prefix https://cd.com code 301 if { hdr(host) -i https://ab.com:9000 }

```

> [@aarathy53](#):
>
> GET /abc HTTP/1.1

Nothing. If the ACL condition doesn’t match than haproxy won’t redirect, and because there are no backend servers defined, you will see some kind of error code in the log file and a 503 error is returned.

---

<div class="post-metadata">

**Author:** ![aarathy53](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aarathy53](https://discourse.haproxy.org/u/aarathy53)\
**Post date:** [March 3, 2020, 8:51pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/24 "2020-03-03T20:51:42Z")

</div>

Yes tried with port 9000 in the condition as per your initial advise , still no luck , thats what is strange about this 🙁😟

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 3, 2020, 8:53pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/25 "2020-03-03T20:53:15Z")

</div>

Then you need to capture the traffic with tcpdump and look at the actual content. We are now 24 posts into a back and forth that won’t go anywhere unless you take an actual look at the incoming traffic.

---

<div class="post-metadata">

**Author:** ![aarathy53](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aarathy53](https://discourse.haproxy.org/u/aarathy53)\
**Post date:** [March 10, 2020, 9:08pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/26 "2020-03-10T21:08:38Z")

</div>

Thanks , I was able to achieve redirection without backend by changing the redirect rule

didnt work for me - redirect prefix [https://cd.com](https://cd.com) code 301 if { hdr(host) -i [https://ab.com:9000](https://ab.com:9000) }

Worked - redirect prefix [https://cd.com](https://cd.com) code 301 if acl url\_ab  
Using the acl rather than the hdrhost condition worked for me

thanks lukas , really appreciate your help 😇

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 10, 2020, 9:11pm UTC](https://discourse.haproxy.org/t/haproxy-backend/4912/27 "2020-03-10T21:11:02Z")

</div>

And how does that working ACL look like exactly?

[Previous page](https://discourse.haproxy.org/t/haproxy-backend/4912.md?page=1)
